views:

651

answers:

3

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?

A: 

possibly, flash plug in / browser relation ship and how it uses cache, check out this link to forum thread, hopefully it will help. http://www.ultrashock.com/forums/actionscript/force-reload-files-only-using-as3-123408.html

GnrlBzik
Flash was being reloaded but the intervals weren't being refreshed. Seems like a bug with flash and IE. Especial when it comes to intervals.
kayem
there some weird stuff like that unfortunately in browser/flash plugin, thank you for pointing out exact issue : )
GnrlBzik
The application/game was using a lot of setIntervals in dif mc's all given unique names running at the same time. Some being removed with clear interval prior to removing mc, (if destroyed by user in game). If the user closed the game. Removed game mc from parent movie. then clicked play ie: load a new instance of game. Some of the setinterval calls were still running. i substituted setinterval with setTimout which would call a function to perform what was needed and at the end set a newTimeout calling function. When mcs were then removed setimeout could no longer run or be called again.
kayem
+2  A: 

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.

Markus Johnsson
The Ctrl-F5 in IE suppresses the If-Modified-Since and If-None-Match headers sent to the server causing content that hasn't changed to be fetched anyway. F5 on its own will still by-pass the local cache.
AnthonyWJones
A: 

I don't know much about flash but this sort of thing happens when supplementary resources are fetched asynchronously.

When refreshing IE will ensure that not only the current document is refreshed but any resources (JS, BMP, SWF, etc) that are reference by elements created during the load period of the refreshed document.

However if additional activity is scheduled to run after the load (say via Javascript setTimeout) and these additional activities load further resources then those resource will not consider themselves to be under refersh context. Hence if they are cacheable and fresh in the cache they will be delivered without roundtripping the server.

Normally when "Automatic" is set IE will ignore any fresh cache content if the resource has never been fetched in the current session. By setting "Every time I visit the page" you extend this behaviour to every visit (including refreshes) instead per session.

AnthonyWJones