发布于2022-06-22 21:44 阅读(1289) 评论(0) 点赞(29) 收藏(2)
在下面的代码中,我试图通过 html 按钮访问 Flash 中的按钮。所以当按下记录按钮时,模式将是“记录”并被 record_functions()
调用。我可以让它在 Firefox 上运行,但在 Internet Explorer 中,这些按钮似乎不起作用,即,无法从 Internet Explorer 调用 Flash 功能。请让我知道如何解决此问题
function thisMovie(movieName)
{
if (window.document[movieName])
{
return document.getElementById(movieName);
}
if (navigator.appName.indexOf("Microsoft Internet")==-1)
{
if (document.embeds && document.embeds[movieName])
return document.embeds[movieName];
}
else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
{
return document.getElementById(movieName);
}
}
function record_functions(mode)
{
if(mode == "record")
{
thisMovie("audiorecoding").startRecording();
}
else if(mode == "stop")
{
thisMovie("audiorecoding").stopRecording();
}
else if(mode == "play")
{
thisMovie("audiorecoding").playRecording();
}
else if(mode == "pause")
{
thisMovie("audiorecoding").pauseRecording();
}
}
<input type="button" onclick="record_functions('record')" value="Record" />
您应该通过id
IE 上的属性获取您的 swf,但name
在其他浏览器中通过属性获取。
if (navigator.appName.indexOf("Microsoft") == -1)
swfObject = document["mozillaEmbedName"];
else
swfObject = window["ieObjectID"];
作者:黑洞官方问答小能手
链接:http://www.qianduanheidong.com/blog/article/371100/49c1ed7f9c17f9902644/
来源:前端黑洞网
任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任
昵称:
评论内容:(最多支持255个字符)
---无人问津也好,技不如人也罢,你都要试着安静下来,去做自己该做的事,而不是让内心的烦躁、焦虑,坏掉你本来就不多的热情和定力
Copyright © 2018-2021 前端黑洞网 All Rights Reserved 版权所有,并保留所有权利。 京ICP备18063182号-3
投诉与举报,广告合作请联系vgs_info@163.com或QQ3083709327
免责声明:网站文章均由用户上传,仅供读者学习交流使用,禁止用做商业用途。若文章涉及色情,反动,侵权等违法信息,请向我们举报,一经核实我们会立即删除!