PDA

View Full Version : How to refresh flash file without clearing cache???



ethancote
May 14th, 2002, 09:50 AM
Hello all,

How do you refresh a flash file on a browser without clearing cache each and every time you do a tweak to the flash file?

Problem:
Each time I tweak a flash file and view it on a browser, the "previous flash version" always get view and not the one I just tweaked. Is there a way to solve this problem in flash itself, without clearing cache to view the new changes?

Or is there some sort of refresh javascript that will solved this problem?

NOTE: Refreshing the browser does not solved the problem.

Thanks to all those that lend a hand here.


Sincerely,

Chi Huynh
Web Designer of EthanCote.com
www.ethancote.com

upuaut8
May 16th, 2002, 12:07 AM
one thing you can try is this.

If you are looking at the Flash file itself.. not an html with the flash in it, you can do it very simply from the browser itself.

When I type into the browser window

www.centerspin.com/myFlashFile.swf (http://www.centerspin.com/myFlashFile.swf)

the first time..it cache's that swf file.

the next time I want to look at that file I type in

www.centerspin.com/myFlashFile.swf?x=1 (http://www.centerspin.com/myFlashFile.swf?x=1)

the ? tells the browser to send a variable to the file in question, and tricks it into believing that it's a new file, rather than the old one you just looked at.

You can also use this method in the html doc that contains an swf. In the address statement of the embed and object tags, you simply add ?x=something to the end of the address, but inside the quotation marks. Everytime you want it to refresh you just change the "something" to something else.

flatline damnation
May 17th, 2002, 02:50 AM
Hmm... I'm interested in this...

But how can you do it automaticaly instead of updating the html everytime, after all every flash.swf?var=1, flash.swf?var=2 etc is a new flash file that is stored in the cache.

Is there a random() thing in html?

upuaut8
May 17th, 2002, 03:31 AM
nope.. but you could use php inside an html page to make random numbers which could in turn be used for that. Though I'll admit that I've never tried it.

One thing to watch for is that if you are making your viewer download everything ever time, he never has the oppertunity to visit your site without having to download EVERYTHING. So, you know I just never had the notion to bother with the random() option to make the SWF's none cacheable the way we do with txt files.