我的代码如下,执行没有反应,那位有好的方法,谢谢!
<script type="text/javascript" language="javascript"> 
function rightKey(){  
        if(event.button==2){        //判断按下的是否是鼠标右键  
            event.returnValue=false;  
            alert("禁止使用鼠标右键!");  
        }  
    } 
</script>
<object id="obj" width=550 height=180 classid="CLSID:106E49CF-797A-11D2-81A2-00E02C015623" onMouseDown="rightKey()">

解决方案 »

  1.   

    事件你应该在106E49CF-797A-11D2-81A2-00E02C015623这个组件里面处理,外面不能处理
      

  2.   

    用用看这个方法:
    right = new Object();
    right.onMouseMove = function() {
    Stage.scaleMode = "noScale";
    };
    Mouse.addListener(right);
      

  3.   

    将object  id 直接bind这个方法:
    bind("contextmenu", function() {
    if (window.event) {
    window.event.returnValue=false;
    }
    });  
    http://www.jb51.net/article/19979.htm
      

  4.   

    要禁用鼠标右键,需要在事件函数里面传入evt参数,IE里面evt=window.event;然后用evt的相关属性获取是否按下鼠标右键,但IE和Firefox存在兼容问题。例如给document加入onlick事件监听函数并判断鼠标按键window.onload=function(){
    document.onmousedown=function(evt){
    evt=evt||window.event;
    if(evt.button===2){
       try{
    evt.preventDefault();
       }catch(e){
    evt.returnValue=false;
       }finally{
    alert('禁止鼠标右键');
       }
    }
    };
    };
      

  5.   

    document.oncontextmenu=function(e){return false;};