I know this is an old thread, but I want to post a simple solution for those who are looking for one that does not require changes to existing JS code. In my case, I had an existing Tabets component that created new tabs and dynamically loaded the html into which SWF was embedded.
IMO, the easiest way to handle this is to place the iframe wrapper around the SWF - then it will not close / reload when you show / hide the Div container.
To fix this problem you just need to insert a simple html shell file.
Old way:
Main application -> HTML loader -> SWF file
New way:
Main application -> iframe loader -> HTML loader -> SWF file
A simple example:
<iframe src="/stuff/swfContainer.html" style="width:100%;height:100%;border:0px;"> </iframe>
then inside swfContainer.html do something like this:
<html> <head> <style> body { margin:0px; } </style> </head> <body> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="MySwf" width="100%" height="100%" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"> <param name="movie" value="/stuff/mySwf.swf" /> <param name="quality" value="high" /> <param name="allowScriptAccess" value="sameDomain" /> <embed src="/stuff/mySwf.swf" quality="high" width="100%" height="100%" name="MySwf" align="middle" play="true" loop="true" quality="high" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"> </embed> </object> </body> </html>
This is a simple code example, since you probably want to use swfobject to load SWF, but I will leave it to you.
PRB
source share