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);
my_cm.customItems.push(copy_cmi);
my_mc.menu = my_cm;
224
Chapter 2: ActionScript Language Reference
original_cmi
. The example then creates a copy of the
onPause
.
copy_cmi
with the caption
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?