Flash XML Caching Solution
MORE TOPS- Forums
- Flash Help
- Flash XML Caching Solution
-
flashreseller
-
Yesterday a customer ask for a solution to this problem. After some research i have found this solution and i think this would help many.
First solution i found is this:
xml.load("xmlFile.xml?"+Math.random());
Essentially, Flash will think that the file is a different URL each time it loads the file and the psuedo parameter (’?+Math.random()&rsquo
will be ignored for the file request. Clever and effective.
Posted on Aug 8, 2009 | Reply | Reply with Quote | Send PM | Report
-
sportswidgets
- Thanks man. Was looking for a solution to fix this issue. Posted on Aug 9, 2009 | Reply | Reply with Quote | Send PM | Report
-
alex
- Thanks FlashReseller for this great fix. Hope that would help all our developers that encounter this problem. Posted on Aug 9, 2009 | Reply | Reply with Quote | Send PM | Report
-
OXYLUS
-
A more effective one would be:
if(_level0._url.indexOf("http://"
>=0){
xml.load("xmlFile.xml?"+String((new Date()).getTime()));
} else {
xml.load("xmlFile.xml"
;
}
This way it will work when ran locally too, in the idea that the query will throw an error if tested locally. Also, with random, even if chances are small, you could get the same number consecutively and therefore load the cached xml. With getTime you can never go wrong, as every time you will get an unique number. Posted on Aug 18, 2009 | Reply | Reply with Quote | Send PM | Report
-
flashreseller
-
Hmmm....
Good idea. I'll test it to see how it works.
Thanks oxylus for this. Posted on Aug 19, 2009 | Reply | Reply with Quote | Send PM | Report
Newest Forum Posts
- New Idea in Web Hosting... last by patrickjansendesign , on Mar 8, 2010
- Low cost web hosting companies list and reviews last by lowcostwebhosting , on Feb 25, 2010
- Non Flash Talk last by flashreseller , on Feb 17, 2010
- Internet Explorer 8 - beta 2 last by jezzicaz789 , on Feb 15, 2010
- Flash Text Warp Tool last by jezzicaz789 , on Feb 15, 2010
- Site Suggestions last by equipo3 , on Nov 7, 2009
- Flash XML Caching Solution last by flashreseller , on Aug 19, 2009
- wormhole last by sportswidgets , on Aug 9, 2009
- Newbie help last by sportswidgets , on Aug 9, 2009
- Flash Help last by asbleo1981 , on Jul 9, 2009
- Search Engine improvement last by gnguven , on Jun 4, 2009
- Unanswered questions last by realbytes , on May 14, 2009
- text with accents, horizontal scroll last by diosanilo , on Apr 19, 2009
- Deposits last by szilaghi , on Apr 10, 2009
- Horizontal scroller last by jpcs , on Feb 25, 2009
- Need flash APP urgently last by fzer08 , on Feb 23, 2009
- Files Support last by alex , on Jan 27, 2009
- what's wrong with my files last by alex , on Jan 27, 2009
- 2 Levels Accordion Menu last by OXYLUS , on Jan 15, 2009
- Need Startup Help last by alex , on Jan 12, 2009
- NEED SCROLL BAR MENU TODAY last by alex , on Jan 8, 2009
- info on video p;reloader/player last by szilaghi , on Dec 18, 2008
- play video based on radio button selection last by hdmyg8586 , on Dec 8, 2008
- Freelance Flash Programmer last by alex , on Nov 17, 2008
- Web Designer last by alex , on Nov 17, 2008
- Flash Player 10 Available for Download last by alex , on Nov 17, 2008
- Stock Flash Wishlist last by sarumitai , on Oct 22, 2008
- Adobe Unveils Creative Suite 4 Web Premium last by alex , on Sep 29, 2008
- Adobe introduces Photoshop CS4 Extended last by alex , on Sep 29, 2008
- Internet 60 times faster - new gear last by johny , on Sep 28, 2008

You need to be logged in in order to post a reply. Please click here to go login and be redirected to the post form.