R – IE7, page refresh not re loading flash vars

actionscript-2flashinternet-explorer-7

I have a site the runs in flash. IE7 will not reload the vars in flash, the vars set by flash in the swf. when the page is reloaded. The thing that bugs me out is refreshing the page actually refreshed the page. The flash started how it was supposed to except the variables in flash didn't reset.

This only happens when the "Temporary Internet Files" settings in IE is set to "automatic". But works how it should when "Everytime I visit The Page" is checked.

What can possibly cause this?

Best Answer

Internet Explorer is probably caching the HTML and/or SWF file. You can by-pass the cache by reloading the browser holding the ctrl-key, but for a more general solution you need to tell the browser not to cache the files.

For HTML files (i.e. the file embedding your SWF) you can add the following meta code:

<meta http-equiv="cache-control" content="no-cache" />

For other files you need to do it on the server side by altering the HTTP headers. If your files are hosted on Apache server, then you can use .htaccess files for this. You can also change the http header of PHP scripts.

Related Topic