我怎样才能删除一个swf文件嵌入在html中使用swf中的按钮? [英] How can I remove a swf file that's embedded in html using a button in the swf?

查看:202
本文介绍了我怎样才能删除一个swf文件嵌入在html中使用swf中的按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个嵌入在html页面中的swf文件,并且在swf页面中有一个关闭按钮,我希望swf消失,当我点击按钮时,最好的方法是什么?如果你的ursing swfobject 2.1嵌入了swf,你可以使用这个内置的javascript swfobject.removeSWF()函数来解决这个问题。



  function removeFlashFromHTML()
{
swfobject.removeSWF(id_of_your_html_object);





$ b现在您可以使用ExternalInterface从Flash中调用javascript函数:



$ $ p $ function buttonClicked(evt:MouseEvent)
{
if(ExternalInterface.available){
ExternalInterface.call removeFlashFromHTML());


$ / code
$ b $ p
$ b $ p

关于SWFObject检查的更多信息这个网站


I have a swf file that's embedded in a html page, and I have a close button in the swf page, I want the swf to disappear when I click on the button, what is the best way to do that? Thanks.

解决方案

If your ursing swfobject 2.1 to embed the swf you can use this built-in javascript swfobject.removeSWF() function:

function removeFlashFromHTML() 
{
 swfobject.removeSWF("id_of_your_html_object");
}

now you call the javascript function from flash using ExternalInterface:

function buttonClicked(evt:MouseEvent) 
{
 if (ExternalInterface.available) {
  ExternalInterface.call("removeFlashFromHTML()");
 }
}

for more information about SWFObject check this website

这篇关于我怎样才能删除一个swf文件嵌入在html中使用swf中的按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆