PDA

View Full Version : How to force a flash movie to reload in IE?


lkelly
03-01-2006, 02:54 AM
I have a database driven flash movie where I pull a sequence of images from an XML config file. The order of images is in that config file. I'm displaying the flash movie on a control panel page which also has form buttons to change the content in the database (i.e. alter the order of the images). Anyway, in Firefox I process the form button and reload the page and I see the flash movie is reflecting my updated image order. In IE, the database is changing but the flash movie still uses the old order. I assume this is because of some caching issue. Is there any way I can force IE to reload the flash each time? I have one parameter I pass to my flash movie (and ID that tells it which subset of images to load) - I tried adding an extra parameter to the load string which contains a random number (dummy variable) but that didn't help. Something along these lines?

<embed src="../core/gallery3_notitle.swf?galleryIDToLoad=1&rnd=86"....

The galleryIDToLoad is important - the rnd variable does nothing in my flash movie.

Anyway, if I could get around this caching issue in IE, I'd be happy. Like I said, in Firefox it works like a charm and the flash reloads with the new data each time the page processes the form.

If anyone has suggestions, I'm all ears.

Simply
03-01-2006, 04:33 AM
You will want to send a header to the browser. Not sure which language you are using but the header should be like so:

Cache-Control: no-cache, must-revalidate

lkelly
03-01-2006, 05:23 AM
php is the language I'm using to build the page. If you have a suggestion on that syntax, it would be great.

Thanks.

Simply
03-12-2006, 06:14 AM
<?php
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
?>

More info here: header - Send a raw HTTP header (http://us3.php.net/manual/en/function.header.php)