直接上代码:
package
{
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
/**
* 完全屏蔽Flash player11.2及其以后的右键菜单方法
* 编译器参数设置-swf-version=15 -target-player=11.2
* @author aisajiajiao
*
*/
public class DisableRightMouse extends Sprite
{
public function DisableRightMouse()
{
addEventListener(Event.ADDED_TO_STAGE,init);
}
private function init(e:Event):void
{
//就是这句话
stage.addEventListener(MouseEvent.RIGHT_CLICK,function(e:MouseEvent):void{});
}
}
}