Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

remove the right click menu in flash 9

Is it possible, using actionscript 3 to disable the right click menu?

Any help greatly appreciated!

like image 785
Cameron A. Ellis Avatar asked Dec 18 '08 06:12

Cameron A. Ellis


4 Answers

You can use:

stage.showDefaultContextMenu = false;

to hide everything but the settings option.

like image 82
Iain Avatar answered Nov 09 '22 22:11

Iain


Starting with Flash Player 11.2, it's possible now to override the behavior for the right button click on the mouse, e.g.

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

Here is the corresponding entry in the ActionScript 3 reference.

like image 21
raju-bitter Avatar answered Nov 09 '22 22:11

raju-bitter


I don't think you can do this in AS3 (Adobe probably never put support in there because it would prevent the user from accessing the security settings).

There are ways to do it through HTML, etc.

Check out http://www.actionscript.org/forums/showthread.php3?t=175669

like image 4
Andy Webb Avatar answered Nov 09 '22 22:11

Andy Webb


You can hide everything except for the Settings item, as said by Lain.

By the way: If you need to customize it you can use the ContextMenu class from the flash.ui package. Call hideBuiltInItems on it first to hide everything except for the Settings and then assign it to the menu property of the object you want to use the menu for (or root for the entire applet).

FYI, there is a nice tutorial about it that you can find here

like image 3
Blizz Avatar answered Nov 09 '22 22:11

Blizz