Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

forcing reload of swf 2

Status
Not open for further replies.

bigbird3156

Programmer
Feb 20, 2001
183
AU
Hi there...

do any of you know how to force a reload of a swf file, so that users will get any updated info to the file...

the swf obviously gets loaded into the users temp internet memory and so they dont get any changes to the file unless this is deleted...

I don't know if I should be asking here or in the java script forum, but I thought I should at least start here first [wiggle]The Bird from Down Under
bigbird_3156@optushome.com.au
 
Are you trying to prevent caching from visit to visit, or do you want to update a current playing movie? Regards,

oldman3.gif
 
Sorry about the delay...

yes I want to update from visit to visit

Thanks [wiggle]The Bird from Down Under
bigbird_3156@optushome.com.au
 
If you're using a loadmovie command to swap between movies, instead of loading different urls, you'll need to use another technique. Basically, to defeat caching, you need to convince the browser that it's downloading a new file every time. Fortunately this is quite simple. The browser will treat the entire url you give it as a single page, and cache it as such, so " is different from " even though they reference the exact same file. So all you need to do is make sure each call you make to your target swf is unique. Appending a unique number as a querystring is ideal. Something like:

Code:
loadMovieNum ("[URL unfurl="true"]http://www.mysite.co.uk/mypage.swf?nocache="[/URL] + Math.round(Math.random()*100000), 0);

Beware of wrapping, the above is all one line.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top