ContextMenu class
Availability
Flash Player 7.
Description
The ContextMenu class provides runtime control over the items in the Flash Player context
menu, which appears when a user right-clicks (Windows) or Control-clicks (Macintosh) on Flash
Player. You can use the methods and properties of the ContextMenu class to add custom menu
items, control the display of the built-in context menu items (for example, Zoom In and Print),
or create copies of menus.
You can attach a ContextMenu object to a specific button, movie clip, or text field object, or to an
entire movie level. You use the
this. For more information about the
TextField.menu
To add new items to a ContextMenu object, you create a ContextMenuItem object, and then add
that object to the
context menu items, see the
Flash Player has three types of context menus: the standard menu (which appears when you right-
click in Flash Player), the edit menu (which appears when you right-click over a selectable or
editable text field), and an error menu (which appears when a SWF file has failed to load into
Flash Player.) Only the standard and edit menus can be modified with the ContextMenu class.
Custom menu items always appear at the top of the Flash Player context menu, above any visible
built-in menu items; a separator bar distinguishes built-in and custom menu items. You can add
no more than 15 custom items to a context menu. You cannot remove the Settings menu item
from the context menu. The Settings menu item is required in Flash so users can access the
settings that affect privacy and storage on their computers. You also cannot remove the About
menu item from the context menu, which is required so users can find out what version of Flash
Player they are using.
You must use the constructor
its methods.
Method summary for the ContextMenu class
Method
ContextMenu.copy()
ContextMenu.hideBuiltInItems()
property of the Button, MovieClip, or TextField classes to do
menu
menu
.
ContextMenu.customItems
ContextMenuItem class
new ContextMenu()
Description
Returns a copy of the specified ContextMenu object.
Hides most built-in items in the Flash Player context menu.
ActionScript Language Reference
property, see
Button.menu
array. For more information about creating
entry.
to create a ContextMenu object before calling
CHAPTER 2
,
, and
MovieClip.menu
ContextMenu class
213
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?
Questions and answers