MACROMEDIA FLEX-FLEX ACTIONSCRIPT LANGUAGE Reference page 526

Actionscript language reference
Table of Contents

Advertisement

ContextMenuItem.caption
Availability
Flash Player 7.
Usage
menuItem_cmi.caption:String
Description
Property; a string that specifies the menu item caption (text) displayed in the context menu.
Example
The following example writes the caption for the selected menu item (Pause Game) to the log file:
var my_cm:ContextMenu = new ContextMenu();
var menuItem_cmi:ContextMenuItem = new ContextMenuItem("Pause Game", onPause);
my_cm.customItems.push(menuItem_cmi);
function onPause(obj, menuItem) {
trace("You chose: " + menuItem.caption);
}
this.menu = my_cm;
ContextMenuItem.copy()
Availability
Flash Player 7.
Usage
menuItem_cmi.copy() : ContextMenuItem
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.
Example
This example creates a new ContextMenuItem object named
Pause and a callback handler set to the function
ContextMenuItem object and assigns it to the variable
var original_cmi:ContextMenuItem = new ContextMenuItem("Pause", onPause);
function onPause(obj:Object, menu:ContextMenu) {
trace("pause me");
}
var copy_cmi:ContextMenuItem = original_cmi.copy();
var my_cm:ContextMenu = new ContextMenu();
my_cm.customItems.push(original_cmi);
526
Chapter 7: ActionScript for Flash
original_cmi
. The example then creates a copy of the
onPause
.
copy_cmi
with the caption

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Flex

Table of Contents