-
curiouser and curiouser
[help] forcing a browser to over-write cached swf?
hi
I've wanted to do some special events type thing in my rpg (just been playing World of Warcraft and their Lunar Festival and Valentine's Special Events got me thinking... )
Normally I want all of my swfs to be cached to save download time, but if one map has a special event, I'd need to make sure that the new swf with the special event graphics in is the one used by the browser. Is there a way to set specific files to be updated?
(I know you can use a query string with the time in to *always* prevent a swf being cached, but most of the time I do want them to be cached)
I can't see a way to do this, but there might be a clever way.
(I'm using php as well, so if there's some kind of server-side trick I can use for individual files, then great)
thanks for any help!
-
CostomJunky
Yeah I just ran into caching problems myself because I split the whole game into different swf files eg. main.swf, menu.swf, and game.swf where main.swf is the one that loads up the other ones. But this way the other swf files don't get updated even when I overwrite them with new parts. The only way I can do that is to go to the seperate swf files and refresh them .
Last edited by Xploder; 02-15-2006 at 07:13 PM.
-
just do
var url = 'myswf.swf'
if ( useSpecialEvent ) {
url += new Date().getTime()
}
loadMovie ( url )
so if you have a special event, a new movie will be loaded, if not, it will try and load a file that may have been cached; if not, it will get cached when loaded
-
curiouser and curiouser
Trickman - thanks - I could set a 'useSpecialEvent' variable in the xml data for each map which doesn't get cached, and then use your code.
-
Official Shoe Shiner
you will never be able to stop anyone from getting the cached swf. Firefox for one will cache it even with query strings AFAIK. When i renamed the swf and put a blank one in its place it did not overwrite the original, just created another file.
Message on a gravestone: I finished before you in the human race.
Using: Flash MX
-
curiouser and curiouser
ok - that's good to know, thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|