如何用JavaScript关闭一个正在播放的Flash视频文件,详细点 如题。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Flash和js都是可以交互的,参见http://stackoverflow.com/questions/706753/stop-music-from-in-flash-from-javascript-eventhttp://www.adobe.com/support/flash/publishexport/scriptingwithflash/ 首先获取Flash对象的句柄,然后调用Flash的方法关闭播放器。 Flash AS:import flash.external.*;var _method : String = "stop"; //JS函数名var method : Function = stop; //AS函数名ExternalInterface.addCallback(_method, this, method);//函数注册function stop(){ ns.pause(true);//ns为FLV流对象(Object)}HTML JS:<object name="player" ................><embed name="player" ................><input type=button value="停止" onclick="flvStop()"><script>function flvStop(){ var Handle = document["player"]||window["player"]; Handle.stop();}</script> object 设置id ,然后清空document.getElementById("objectid").outerHTML=""; 请问你们写代码用什么工具?? 那位高手能留下QQ嘛,方便交流啊。 关于jquery验证 下拉列表框中的选项问题 多个form验证问题? 这个怎样实现呢 请帮我解释一下下面的代码的整个逻辑,谢谢! 关于url的正则表达式的问题! 主窗口控制弹出的子窗口的问题, 多个子窗口! extjs4 把Grid 添加到 tabpanel hidden标签值安全问题 这样使用P3P
http://stackoverflow.com/questions/706753/stop-music-from-in-flash-from-javascript-event
http://www.adobe.com/support/flash/publishexport/scriptingwithflash/
import flash.external.*;
var _method : String = "stop"; //JS函数名
var method : Function = stop; //AS函数名
ExternalInterface.addCallback(_method, this, method);//函数注册
function stop(){
ns.pause(true);//ns为FLV流对象(Object)
}
HTML JS:
<object name="player" ................>
<embed name="player" ................>
<input type=button value="停止" onclick="flvStop()"><script>
function flvStop(){
var Handle = document["player"]||window["player"];
Handle.stop();
}
</script>
document.getElementById("objectid").outerHTML="";