Singapore CMS Web Design

Gary Consulting Group - Singapore CMS Web Design

Timely Support and Clarity in your journey to harness the power of the internet
Email:
sales@name1price.com
Call:
+1 415 300-0019
Internet Explorer script workaround compatiblity for Flash ActionScript

Recently while coding a new game in Flash using PHP I encountered the following problem.

There is a location with the url : http://example/give_me_new_xml_data

In my Flash code my script is as such

var my_xml:XML = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(success){

_level0.debug_text.text += "\r\nSuccessful loading";
_level0.debug_text.text += this;



}
//method A
my_xml.load("http://example/give_me_new_xml_data");

Have this script runned when a button is clicked. Compile the flash file and have it embedded in some html files and runned on some browers.

On most browsers, it works fine. Each time the browser is clicked a new copy of the XML data is loaded. This however is not the case for Internet Explorer (I am using Internet Explorer Version 9)

In the Internet Explorer, the new version of the XML data is not loaded when the button is clicked however the old version gets reloaded each time instead. So the possible work around to this will be to modify the url like the below

var my_xml:XML = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(success){

_level0.debug_text.text += "\r\nSuccessful loading";
_level0.debug_text.text += this;



}
//Method B
my_xml.load("http://example/give_me_new_xml_data&counter="+Math.random()*10000);
Technically there is not much difference between Method A and B, since the server side script generates new XML data independent of the values parsed into the Query String. However the Internet Explorer actually recognises the call in Method B as a new unique call and actually loads the new XML data generated from the server side script.

 
Tuesday, 27th Jun 2017
Content Management System powered by Gary from Name1Price.com