MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference page 222

Actionscript language reference
Table of Contents

Advertisement

Constructor for the ContextMenuItem class
Availability
Flash Player 7.
Usage
new ContextMenuItem(caption:String,
Parameters
A string that specifies the text associated with the menu item.
caption
callbackFunction
separatorBefore
the menu item in the context menu. The default value is
A Boolean value that indicates whether the menu item is enabled or disabled in the
enabled
context menu. The default value is
A Boolean value that indicates whether the menu item is visible or invisible. The
visible
default value is
true
Returns
A reference to a ContextMenuItem object.
Description
Constructor; creates a new ContextMenuItem object that can be added to the
ContextMenu.customItems
Example
This example adds Start and Stop menu items, separated by a bar, to the ContextMenu object
. The
my_cm
startHandler()
stopHandler()
current Timeline.
var my_cm:ContextMenu = new ContextMenu();
my_cm.customItems.push(new ContextMenuItem("Start", startHandler));
my_cm.customItems.push(new ContextMenuItem("Stop", stopHandler, true));
function stopHandler(obj, item) {
trace("Stopping...");
}
function startHandler(obj, item) {
trace("Starting...");
}
this.menu = my_cm;
222
Chapter 2: ActionScript Language Reference
callbackFunction:Function,
[ separatorBefore:Boolean,
[ enabled:Boolean,
[ visible:Boolean] ] ] ) : ContextMenuItem
A function that you define, which is called when the menu item is selected.
A Boolean value that indicates whether a separator bar should appear above
true
. This parameter is optional.
array.
function is called when Start is selected from the context menu;
is called when Stop is selected. The ContextMenu object is applied to the
false
. This parameter is optional.
. This parameter is optional.

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx

Table of Contents