MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT Reference Manual page 338

Actionscript reference guide
Hide thumbs Also See for FLASH MX 2004 - ACTIONSCRIPT:
Table of Contents

Advertisement

Example
In this example, the built-in Quality and Print menu items are disabled for the ContextMenu
object
, which is attached to the root Timeline of the SWF file.
my_cm
var my_cm = new ContextMenu ();
my_cm.builtInItems.quality=false;
my_cm.builtInItems.print=false;
_root.menu = my_cm;
In the next example, a
menu items of the ContextMenu object,
my_cm = new ContextMenu();
for(eachProp in my_cm.builtInItems) {
var propName = eachProp;
var propValue = my_cm.builtInItems[propName];
trace(propName + ": " + propValue;
}
ContextMenu.copy()
Availability
Flash Player 7.
Usage
my_cm.copy()
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
my_cm = new ContextMenu();
my_cm.hideBuiltInItems();
my_cm.customItems.push(new ContextMenuItem("Save...", saveHandler);
function saveHandler (obj, menuItem) {
saveDocument(); // custom function (not shown)
}
clone_cm = my_cm.copy();
338
Chapter 12: ActionScript Dictionary
loop enumerates through all names and values of the built-in
for..in
my_cm
, which inherits all the properties of the original menu.
clone_cm
.
my_cm
whose built-in menu items
and
my_cm

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?

Table of Contents