Remove .swf from HTML once played

1.2k Views Asked by At

I have taken an absolutedly positioned element on the page and have inserted a flash swf in it. The problem is, that the links behind the flash movie does not work. I want the flash movie to disappear and totally unload after it finishes playing.

Note: I have tested the unloadMovie(); Thing but does't help.

2

There are 2 best solutions below

0
On

You could use the methods which are created for removing the object, ins

var flashvars = {
    name1: "hello",
    name2: "world",
    name3: "foobar"
};
var params = {
    menu: "false"
};
var attributes = {
    id: "testflash",
    name: "test-swf"
};

swfobject.embedSWF("test.swf", "myContent", "300", "120", "10.2.0","expressInstall.swf", flashvars, params, attributes);

swfobject.removeSWF("testflash");


<div id="myContent">
    <h1>Alternative content</h1>
    <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
</div>

https://code.google.com/p/swfobject/wiki/documentation

3
On

Let's say your flash object is inside a div with the id "mydiv":

<div id="mydiv">
<!--Your flash object goes here -->
</div>

Let's assume that you imported JQuery in your document. Then, as soon as you want to delete the flash video you do:

$("#mydiv").html("");

This will basically empty the content of the div, removing the video. Link to a fiddle that demonstrates the effect: http://jsfiddle.net/xCc5H/2/.

NB: unloadmovie is in actionscript and not javascript