marconiduarte / swfobject

Automatically exported from code.google.com/p/swfobject
0 stars 0 forks source link

IE stores previous state of SWF on subsequent page loads. #311

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1. Print numChildren, then add 20 Items to the stage 
2. Open page in IE6 or 7 (only tested on windows XP)
3. Refresh or navigate to another html page with the same swf embedded.

On first load print of numChildren is 0, as expected, on refresh or second 
load, it is 20 (should 
be 0 since the html page has reloaded).

Using SWFObject 2.0-2.2 beta.

Please provide any additional information below.
This isn't a problem when using adobe's javascript based embed code, and isn't 
an issue in any 
other browsers on Windows or Mac.

I've included a sample Flex 3 app that reproduces the problem.

Original issue reported on code.google.com by collin.p...@gmail.com on 13 May 2009 at 10:40

Attachments:

GoogleCodeExporter commented 9 years ago
This is a known issue and in our opinion an IE bug. Also there is not much that 
we
can do about this.

The difference with Adobe's JavaScript code:
- SWFObject uses innerHTML (which causes different behavior) while Adobe's code 
uses
document.write (document.write imposes several severe drawbacks)
- ideally we would have like to have used W3C DOM methods only, however IE has 
an
incomplete and kind-of hacked implementation of the object/embed element in its 
DOM  

The best workaround to avoid this issue is to use something like:
swfobject.embedSWF( "IETester.swf?nocache=" + new Date().getTime(),
"myAlternativeContent", "800", "600", ...

Original comment by bobbyvandersluis on 26 May 2009 at 9:52