MACROMEDIA FLEX-FLEX ACTIONSCRIPT LANGUAGE Reference page 520

Actionscript language reference
Table of Contents

Advertisement

var propValue = my_cm.builtInItems[propName];
trace(propName + ": " + propValue);
}
ContextMenu.copy()
Availability
Flash Player 7.
Usage
my_cm.copy() : ContextMenu
Parameters
None.
Returns
A ContextMenu object.
Description
Method; creates a copy of the specified ContextMenu object. The copy inherits all the properties
of the original menu object.
Example
This example creates a copy of the ContextMenu object named
are hidden, and adds a menu item with the text "Save...". It then creates a copy of
assigns it to the variable
var my_cm:ContextMenu = new ContextMenu();
my_cm.hideBuiltInItems();
var menuItem_cmi:ContextMenuItem = new ContextMenuItem("Save...",
saveHandler);
my_cm.customItems.push(menuItem_cmi);
function saveHandler(obj, menuItem) {
// saveDocument();
// custom function (not shown)
trace("something");
}
clone_cm = my_cm.copy();
this.menu = my_cm;
for (var i in clone_cm.customItems) {
trace("clone_cm-> "+clone_cm.customItems[i].caption);
}
for (var i in my_cm.customItems) {
trace("my_cm-> "+my_cm.customItems[i].caption);
}
520
Chapter 7: ActionScript for Flash
, which inherits all the properties of the original menu.
clone_cm
whose built-in menu items
my_cm
my_cm
and

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