views:

154

answers:

2

I'm using a flash rotating banner in my website which takes images and descriptions from an XML file.

I do changes to my XML very often... but in my local machine, the banner takes a day or two to get updated.

Although I can clear my local machine's cache, the problem still remains for other users who visit my web page..

is there a programmatic way in flash or in html to overcome this problem ? Maybe a server configuration? Please help me with this..

PS: below code works fine, but it clears out the cache completely... i need to clear XMl cache after a specific time period.. please help.

var timestamp:Date = new Date(); 
xmlData.load("/flash/images.xml?cachebuster=" + timestamp.getTime());
A: 

If you want to clear the cache every day, use this:

var timestamp:Date = new Date(); 
xmlData.load("/flash/images.xml?cachebuster=" + timestamp.getMonth() + timestamp.getDate());
Sam
I've added this code in the first frame.. i don't think its working correctly because I havent used stop(); should I use a stop() at the beginning of the code or ur code will do the trick itself? And, thnx a lot Sam :D
mult1
Please ignore the previous comment.. u saved my day. it works perfectly.thank you loads. Cheers !!!
mult1
A: 

If you desperately need the XML to update continuously (like live-statistics) you can call the code each time your banner loops before populating your content.

In general, Sam's code is fine - often you don't need your flash to clear the XML after a time period - it only needs to clear each time the user views your banner.

Garrt