ouyang789987 / swfobject

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

Add clean boolean to removeSWF() method (Enhancement) #460

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In a recent project I was working on, I has to use removeSWF to completely
clean up the SWF from continuing to play on IE, however found that calling
removeSWF completely removed the base element that the video was attached
too which prevented me from using that same element to attach a different
SWF later. My quick fix was to just rebuild the element when removeSWF was
called but thought it would be a great feature to just add a cleanup
boolean to the method which would preserve or remove the base element.

Example: 
swfobject.removeSWF(objElemIdStr, preserve_element:Boolean)

Thanks for all your hard work, I use this script often and look forward to
it's evolution. 

Original issue reported on code.google.com by ext.chr...@gmail.com on 22 Apr 2010 at 6:22

GoogleCodeExporter commented 9 years ago
Good suggestion, we'll consider it. Thanks.

Original comment by platelu...@gmail.com on 7 Nov 2010 at 9:39

GoogleCodeExporter commented 9 years ago
Upon further reflection, I'm not sure I follow you.  SWFObject removes the base 
element when it generates the <object>.  You can't preserve an element that has 
already been destroyed.

The technique we currently recommend is to generate a new <div> when needed. 
There's an example here:
http://learnswfobject.com/advanced-topics/load-a-swf-using-javascript-onclick-ev
ent/

(Scroll down to "Replacing a loaded SWF with another SWF")

Original comment by platelu...@gmail.com on 18 May 2011 at 8:24