How can I delete a SWF file embedded in html using a button in swf?
3 answers
If your wursing swfobject is 2.1 to embed swf, you can use this built-in javascript swfobject.removeSWF () function:
function removeFlashFromHTML()
{
swfobject.removeSWF("id_of_your_html_object");
}
now you are calling javascript function from flash using ExternalInterface:
function buttonClicked(evt:MouseEvent)
{
if (ExternalInterface.available) {
ExternalInterface.call("removeFlashFromHTML()");
}
}
for more information on checking SWFObject this website
+2
source to share
Heres an article on how to get flash to trigger some JS on your page. If you never want it (after hiding), I suggest you remove it from the DOM to free up resources, as a flash drive is expensive in client environments.
+1
source to share