MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference page 214

Actionscript language reference
Table of Contents

Advertisement

Property summary for the ContextMenu class
Property
ContextMenu.builtInItems
ContextMenu.customItems
Event handler summary for the ContextMenu class
Property
ContextMenu.onSelect
Constructor for the ContextMenu class
Availability
Flash Player 7.
Usage
new ContextMenu ([callBackFunction])
Parameters
callBackFunction
Control-clicks, before the menu is displayed. This parameter is optional.
Returns
A reference to a ContextMenu object.
Description
Constructor; creates a new ContextMenu object. You can optionally specify an identifier for an
event handler when you create the object. The specified function is called when the user invokes
the context menu, but before the menu is actually displayed. This is useful for customizing menu
contents based on application state or based on the type of object (movie clip, text field, or
button) or the Timeline that the user right-clicks or Control-clicks. (For an example of creating
an event handler, see
Example
The following example hides all the built-in objects in the Context menu. (However, the Settings
and About items still appear, because they cannot be disabled.)
var newMenu:ContextMenu = new ContextMenu();
newMenu.hideBuiltInItems();
this.menu = newMenu;
In this example, the specified event handler,
item (using the
ContextMenu.customItems
named
showItem
214
Chapter 2: ActionScript Language Reference
Description
An object whose members correspond to built-in context
menu items.
An array, undefined by default, that contains
ContextMenuItem objects.
Description
Invoked before the menu is displayed.
A reference to a function that is called when the user right-clicks or
ContextMenu.onSelect
. If
, the custom menu item is disabled; otherwise, it's enabled.
false
.)
, enables or disables a custom menu
menuHandler
array) based on the value of a Boolean variable

Advertisement

Table of Contents
loading
Need help?

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

This manual is also suitable for:

Flash mx

Table of Contents