如何用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=""; 脚本错误 JS 计算的结果 保留两位小数 小白TWO~~... 类似购物车问题 一个js控制问题 元素添加不了 选 A 吧? 关于网页编辑器的问题 求助 光标自动换行!进来帮忙,thanks 为什么我的这段javascript代码不能运行啊? 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="";