remove the right click menu in flash 9

我只是一个虾纸丫 提交于 2019-12-01 16:04:47

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

You can use:

stage.showDefaultContextMenu = false;

to hide everything but the settings option.

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.

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

Narusake

this code would also work

var newMenu=new ContextMenu();
newMenu.hideBuiltInItems();
this.menu = newMenu;
Yago

Hello a couple of years later. I had the same problem but while using a touch-screen. If you keep the pointing device (my finger) touching the screen for more than a second the "right-click menu" will show up. I soved it going to the control panel under Windows7, "Pencil and input devices", Touch Tab, Actions, Turn off actions for "Keep pressed".

My windows is in spanish and the names are problably a bit different but I'm sure you'll know which button is which.

anjan

This is a better option

_level1._y = 195;
var myMenu:ContextMenu = new ContextMenu();
myMenu.hideBuiltInItems();
_root.menu = myMenu;

If you can live with wmode opaque then you can intercept the right click at browser level as done here:

http://www.uza.lt/rightclick/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!