I had a question and have never really seen any information on this. Below is a thread that explains how to “SOLVE CACHE PROBLEMS” by loading a uniquely named swf within flash. Does anybody know how to do this in Javascript perhaps so that the visitor does not have to clear their temporary internet files to get the latest swf update? I realize the easy solution might be to just put a revision number/letter on your swf everytime you make an update. Please see below.
Solve Cache Problems when you Load a Movie
by ilyas usal
When you load a movie, variables, or a text, what you load is put in the cache of your computer by your browser. This can cause problems because if you load files, chances are that you are going to update them quite often, but Flash will look for the files in the cache, that is to say the old ones.
The solution is to load your files with a unique identifier. Example:
I don’t know of a Javascript way. Well I believe there is a way to have your site not cache anything at all, but I am not sure I remember how to do that.
Anyway, if you have the flash file, why not just do that to the flash file? It would be easier than the javascript way.
Just as a note: This will keep everything from caching, so if you have any images on your site as well, those will have to load from scratch again. But that will be the same with any other way of doing it outside of Flash.
Thanks for the txt file. I will try to clear the cache through the HTML code.
lostinbeta,
Anyway, if you have the flash file, why not just do that to the flash file? It would be easier than the javascript way.
I guess I am a little bit confused. Typically you have a main swf that loads smaller swfs. I understand how to use the code I posted to load the smaller swfs, but the main swf is embedded in the html page. That is why I thought you had to do the main swf through Javascript. However, I guess you could embed a generic swf and load your main swf into the generic one. What do you think? I know. My brain is starting to smoke. Must not think too much.
Well right now I have most of my content minus some large pics and text files in my main movie (166kb). Eventually I will make each section of the site a loaded swf and my main swf will probably be just my navigation.
in times of flash 5 and even now out of habit, my methodology in designing online flash projects was (is)
[pre-loader/title screen] --loadmovie–> [main movie]
the title screen contained well the title screen as well as the preloader to the actual bulk content movie swf. This of course gave you a fully functional preloader for the entire loaded swf which most of you might have had problems with in Flash 5 (“why does my preloader start at 40%?”).
Anyway, for online testing, the typical method of loading an uncached movie was throwing a random number on the end of the url. Basically:
The round and 10000 is redundant. Anyway, this does the trick just fine and doesnt force a reload of any other of the content on the page.
However, if testing both off the harddrive/in flash and online (or just testing on the harddrive and making sure online content isnt cached) you might want to use the following since appending a random number on the end of a swf and trying to load it off the harddrive will result in a file not found…
let me get this straight, are you telling me that if i put a random number on the end of the url it will force to load an uncached movie ?
and that it will work online, but not offline (testing in flash) ??
if that´s so, this is worth of tricks of the trade in the best of kirupa, coz it´s so simple… :A+: