Prevent XML caching problem
Posted on June 8, 2009
When load xml files by URLLoaders, they are often cached by the browsers and do flash is unable to display the updated data. This is a very common problem & I always find this some where around me once in a month or so. Even my friends do face the same issue.
There is a very simple solution to this cute little problem. When ever you are loading by URLLoader.load method just add a time stamp to the URLRequest and everything will work fine except you might get some error message while compiling the swf.(”Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL”). You can ignore it and continue publishing. On the web it will not throw any such error- believe me.
Here is the little rabbit:
-
var xmlPath:String="replaceYourXMLPathHere.xml"
-
var urlReq:URLRequest = new URLRequest(xmlPath+"?time=" + new Date().getTime());
Let me know if the readers have some other idea..
Posted Under AS3 »
Comments
2 Responses to “Prevent XML caching problem”
Leave a Reply


mahesh on March 31st, 2010 10:33 am
Hello,
am getting the same problem xml cache.
Could help me,I have no idea where to place your script.
Thanks
Newton on April 1st, 2010 11:51 am
where ever you are putting your request to seek data.