[SWFObject] How do I dynamically remove swfobject using javascript

Terry Cali swfobject-deconceptcom at dedicatedmanagers.com
Thu Sep 7 09:05:40 PDT 2006


I have a flash movie embedded in one of my pages using SWFobject.  Say I 
want to remove the SWFobject and replace it with text.  I'm trying the 
following function that I created, but it doesn't seem to work.  It works to 
replace other DIV tag contents, but it does not work on the DIV that has 
been changed by SWFobject to have a flash movie in it.

function removeSWFobject(){
    document.getElementById("mySWFobjectDIVcontainer").firstChild.nodeValue 
= "text to replace flash movie";
}

Is there a way to remove the SWFobject?  I tried setting the DIV style 
attribute to "none", but the audio of the flash movie keeps playing, so the 
flash object has not been removed. 




More information about the Swfobject mailing list