ContextMenuItem.onSelect

Availability

Flash Player 7.

Usage

menuItem_cmi.onSelect = function (obj, menuItem) {
  // your statements here
}

Parameters

obj A reference to the movie clip (or Timeline), button, or selectable (editable) text field that the user right-clicked or Control-clicked.

menuItem A reference to the selected ContextMenuItem object.

Returns

Nothing.

Description

Event handler; invoked when the specified menu item is selected from the Flash Player context menu. The specified callback handler receives two parameters: obj, a reference to the object under the mouse when the user invoked the Flash Player context menu, and menuItem, a reference to the ContextMenuItem object that represents the selected menu item.

Example

The following example assigns a function to the onSelect handler for a ContextMenuItem object named start_cmi. The function displays the caption of the selected menu item.

start_cmi.onSelect = function (obj, item) {
    trace("You choose: " + item.caption);
}

See also

ContextMenu.onSelect