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 my_cm whose built-in menu items are hidden, and adds a menu item with the text "Save...". It then creates a copy of my_cm and assigns it to the variable clone_cm, which inherits all the properties of the original menu.

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();