EasyManua.ls Logo

MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT - Page 343

MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT
816 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
ContextMenuItem.copy() 343
my_cm = new ContextMenu();
my_cm.customItems.push(new ContextMenuItem("Start", startHandler));
my_cm.customItems.push(new ContextMenuItem("Stop", stopHandler, true));
function stopHandler(obj, item) {
trace("Stopping...");
}
function startHandler(obj, item) {
trace("Starting...");
}
_root.menu = my_cm;
ContextMenuItem.caption
Availability
Flash Player 7.
Usage
menuItem_cmi.caption
Description
Property; a string that specifies the menu item caption (text) displayed in the context menu.
Example
This example displays the caption for the selected menu item (Pause Game) in the Output panel.
my_cm = new ContextMenu();
menuItem_cmi = new ContextMenuItem("Pause Game", onPause);
my_cm.customItems.
function onPause(obj, menuItem) {
trace("You chose: " + menuItem.caption);
}
ContextMenuItem.copy()
Availability
Flash Player 7.
Usage
menuItem_cmi.copy();
Returns
A ContextMenuItem object.
Description
Method; creates and returns a copy of the specified ContextMenuItem object. The copy includes
all properties of the original object.

Table of Contents

Related product manuals