2

我在页面上采用了一个绝对定位的元素,并在其中插入了一个 flash swf。问题是,flash 电影背后的链接不起作用。我希望 Flash 电影在播放完毕后消失并完全卸载。

注意:我已经测试了这个unloadMovie();东西,但没有帮助。

4

2 回答 2

3

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

于 2011-11-21T07:36:34.727 回答
1

您可以使用为删除对象创建的方法,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

于 2014-12-11T09:41:29.370 回答