actionscript-3flashactionscriptadobecs3

How to disable Rewind/Forward options?


You know when you right-click on a scene and a bunch of options pop up? How do you disable the rewind and forward options (in-case a user accidentally presses on one of those options) because it screws my whole Flash game up.


Solution

  • You can disable most of the context menu with

    stage.showDefaultContextMenu = false;
    

    This will still leave the Settings and About sections though

    There was a trick to completely remove the right click menu by catching up right click events on the stage, no idea if it still works with the current flash player versions:

    stage.addEventListener(MouseEvent.RIGHT_CLICK, doNothing);
    
    private function doNothing(e:MouseEvent):void 
    {
        //do nothing...
    }