Skip to main content
March 5, 2010
Answered

disable Flash context menu in AS 3

  • March 5, 2010
  • 2 replies
  • 1096 views

I want to disable the context menu in flash movie.I have tried some solutions on the internet but none of them work.I am using Flash CS4 with ActionScript 3.I am really frustrated and would appreciate a straight-forward working solution.

This topic has been closed for replies.
Correct answer Marghoob Sulemaan

var myContextMenu:ContextMenu = new ContextMenu();
myContextMenu.hideBuiltInItems();
var defaultItems:ContextMenuBuiltInItems = myContextMenu.builtInItems;
this.contextMenu = myContextMenu;

Above code should work. But you will still find some context menu ie "Show redraw regions", "settings" etc. I dont know how to hide them.

2 replies

kglad
Community Expert
Community Expert
March 5, 2010

you can't.

Marghoob Sulemaan
Marghoob SulemaanCorrect answer
Inspiring
March 5, 2010

var myContextMenu:ContextMenu = new ContextMenu();
myContextMenu.hideBuiltInItems();
var defaultItems:ContextMenuBuiltInItems = myContextMenu.builtInItems;
this.contextMenu = myContextMenu;

Above code should work. But you will still find some context menu ie "Show redraw regions", "settings" etc. I dont know how to hide them.

March 5, 2010

thanks a lot.I didn't want to get rid of the menu totally,just some options like play/loop/zoom etc .So your code snippet worked perfectly.