FLASH中检测与右键屏蔽实例

作者:袖梨 2022-06-28
代码如下 复制代码





FLASH中键检测与右键屏蔽




var so = new SWFObject("FL.swf", "flash", "800", "600", "9", "#CCCCCC");
so.addParam("wmode", "opaque");
so.write("flashcontent");
function callFlash(){
//alert("中键");
document.getElementById("flash").onClick();
}
if(window.addEventListener){
window.addEventListener("mousedown",function(e){
if(e.button==1)callFlash();
//屏蔽右键
if(e.button==2){
if (e.stopPropagation) e.stopPropagation();
if (e.preventDefault) e.preventDefault();
if (e.preventCapture) e.preventCapture();
if (e.preventBubble) e.preventBubble();
}
},true);
}else{
document.getElementById("flashcontent").onmousedown=function(){
if(event.button==4)callFlash();
//屏蔽右键
if(event.button==2){
document.oncontextmenu=function(){return false;};
this.setCapture();
this.onmouseup=function(){
this.releaseCapture();
}
}
}
}


https://www.111cn.net/down/FLASH中键检测与右键屏蔽.rar

相关文章

精彩推荐