tags:

views:

240

answers:

3

I have a main flash from wich i load another swf file from the server. From time to time i change the second swf file and want to load a fresh copy from the server. I clean the cache from the browser but my client does not know how to do that and it's a pain to give him directions. If i want to load a fresh copy of the main swf i just add a "main.swf?version2" but i can't do that with the loadMovie function in flash.

Any ideas how i can get a fresh copy from the server without changing the name of the file?

A: 

You could try the following:

<meta http-equiv="expires" value="Thu, 16 Mar 2000 11:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />

In the html page that embeds the file.

evilpenguin
+1  A: 

i always use a random number

main.swf?version=Math.random()

Andy Jacobs
yes, that works when you "call" the flash from html, but it won't work if you load a movie clip from another swf with the loadMovie function.
Daniel
Why doesn't it work? I'm fairly certain I've loaded movies programatically that had query parameters.
Herms
my bad...i tested the loadMovie localy on windows...and the url to the file was rong, online works perfectly. Thanks
Daniel
A: 

You need to serve the second .swf with headers that prohibit caching. There are quite a number of ways to do it, depending on your web server.

i work on a shared host server, can you give more details?
Daniel