Posted By

activetofocus on 12/17/10


Tagged

URLRequestURLLoaderLoaderDatecacheflashxmljpegpngfilesloaddelect


Versions (?)

Who likes this?

8 people have marked this snippet as a favorite

swapnil
adrianparr
Leang
albertomori
thastyle
jafar
shalomfriss
Neilwhittaker


How to load the latest XML file to solve the cache problem


 / Published in: ActionScript 3
 

URL: http://activetofocus.com/blog/how-to-load-the-latest-xml-file-to-solve-the-cache-problem-18/

Useful technology

  1. Many browser have cache for load file.But some one need client to see latest data so that we must delete the cache.Then we need to solve the cache problem.
  2.  
  3. About load file,we often load xml files/swf files/images files etc.... we can use ?cache =new Date().getTime
  4.  
  5. For example:
  6.  
  7. var load:URLLoader = new URLLoader();
  8. load.load(new URLRequest("data.xml" + "?cache=" + new Date().getTime()));
  9.  
  10. or
  11.  
  12. var load:Loader = new Loader();
  13. load.load(new URLRequest("atf.jpg" + "?cache=" + new Date().getTime()));

Report this snippet  

You need to login to post a comment.