最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Removing swf object with javascript - Stack Overflow

programmeradmin1浏览0评论

I am having a big problem over here. I am building a webpage having little flash animations in it. But the thing is I am not that familiar with flash and all related topics... It's a recipe for long nights.

What I am trying to do:
Here you see the code for embedding my swf object in html. (it is statically; without js)

<object id="removeme" data="objects/junge_leute.swf" type="application/x-shockwave-flash" width="173" height="190">
<param name="movie" value="flash/junge_leute.swf">
<param name="quality" value="high">
<param name="wmode" value="transparent" />
<param name="scale" value="noscale">
<param name="menu" value="false">
<param name="loop" value="false" />
<param name="allowScriptAccess" value="always" />

And in actionscript I call (after animation is done) a javascript method.

Until now everything is woking fine! Here es the problem: With javascript I need to remove that object from code. How can I achieve that. I tried .empty(), .remove().. even It is very urgent. Any Ideas?

I am having a big problem over here. I am building a webpage having little flash animations in it. But the thing is I am not that familiar with flash and all related topics... It's a recipe for long nights.

What I am trying to do:
Here you see the code for embedding my swf object in html. (it is statically; without js)

<object id="removeme" data="objects/junge_leute.swf" type="application/x-shockwave-flash" width="173" height="190">
<param name="movie" value="flash/junge_leute.swf">
<param name="quality" value="high">
<param name="wmode" value="transparent" />
<param name="scale" value="noscale">
<param name="menu" value="false">
<param name="loop" value="false" />
<param name="allowScriptAccess" value="always" />

And in actionscript I call (after animation is done) a javascript method.

Until now everything is woking fine! Here es the problem: With javascript I need to remove that object from code. How can I achieve that. I tried .empty(), .remove().. even It is very urgent. Any Ideas?

Share asked Mar 19, 2012 at 20:58 iSteffiiSteffi 1782 silver badges11 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 4

If you're using SWFObject 2.2, you can use the swfobject.removeSWF method.

swfobject.removeSWF("removeme");
document.getElementById('removeme').parentNode.removeChild(document.getElementById('removeme'));
发布评论

评论列表(0)

  1. 暂无评论