User Guide
522 Chapter 7: ActionScript for Flash
Description
Method; hides all built-in menu items (except Settings) in the specified ContextMenu object. If
the Flash Debug Player is running, the Debugging menu item shows, although it is dimmed for
SWF files that don’t have remote debugging enabled.
This method hides only menu items that appear in the standard context menu; it does not affect
items that appear in the edit or error menus. For more information about the different menu
types, see the ContextMenu class entry.
This method works by setting all the Boolean members of
my_cm.builtInItems to false. You
can selectively make a built-in item visible by setting its corresponding member in
my_cm.builtInItems to true (as demonstrated in the following example).
Example
The following example creates a new ContextMenu object named my_cm whose built-in menu
items are hidden, except for Print. The menu object is attached to the current Timeline.
var my_cm:ContextMenu = new ContextMenu();
my_cm.hideBuiltInItems();
my_cm.builtInItems.print = true;
this.menu = my_cm;
ContextMenu.onSelect
Availability
Flash Player 7.
Usage
my_cm.onSelect = function (item:Object, item_menu:ContextMenu) : Void{
// your code here
}
Parameters
item
A reference to the object (movie clip, button, or selectable text field) that was under the
mouse pointer when the Flash Player context menu was invoked and whose
menu property is set
to a valid ContextMenu object.
item_menu A reference to the ContextMenu object assigned to the menu property of object.
Returns
Nothing.
Description
Event handler; called when a user invokes the Flash Player context menu, but before the menu is
actually displayed. This lets you customize the contents of the context menu based on the current
application state.
You can also specify the callback handler for a ContextMenu object when you construct a new
ContextMenu object. For more information, see the ContextMenu class entry.