2015-03-31 54 views
0

这应该是非常简单的。在Flash中禁用上下文菜单和鼠标

这应该做的伎俩

stage.removeEventListener(MouseEvent.RIGHT_CLICK, function(e:MouseEvent):void{}); 
Mouse.hide(); 

,当我在独立播放器中运行它,它的工作原理。

但是,当我在浏览器中运行它,右键菜单再次出现。我尝试设置参数wmode="opaque",它删除上下文菜单(独立于代码),但显示鼠标尽管css设置:cursor: none;

是否有另一个侦听器调用可禁用的上下文菜单?

回答

1

要禁用上下文菜单(与右键),你可以使用MouseEvent.RIGHT_CLICK和/或MouseEvent.CONTEXT_MENU(可从使用Flash Player 11.2及以上):

stage.addEventListener(MouseEvent.RIGHT_CLICK, function(e:MouseEvent):void {}); 
stage.addEventListener(MouseEvent.CONTEXT_MENU, function(e:MouseEvent):void {}); 

Mouse.hide(); 

希望能有所帮助。

+0

谢谢,'MouseEvent.CONTEXT_MENU'做到了 – Daniel 2015-04-01 14:49:20

相关问题