Contextmenu.customitems - MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

ContextMenu.customItems

Availability
Flash Player 7.
Usage
my_cm.customItems:Array
Description
Property; an array of ContextMenuItem objects. Each object in the array represents a context
menu item that you have defined. Use this property to add, remove, or modify these custom
menu items.
To add new menu items, you first create a new ContextMenuItem object, and then add it to the
menu_mc.customItems
creating new menu items, see the
Example
The following example creates a new custom menu item called
"Send e-mail" and a callback handler named
to the ContextMenu object,
attached to a movie clip named
var my_cm:ContextMenu = new ContextMenu();
var menuItem_cmi:ContextMenuItem = new ContextMenuItem("Send e-mail",
emailHandler);
my_cm.customItems.push(menuItem_cmi);
email_mc.menu = my_cm;
function emailHandler() {
trace("sending email");
}
See also
Button.menu,
ContextMenu
218
Chapter 2: ActionScript Language Reference
array (for example, using Array.push()). For more information about
ContextMenuItem class
emailHandler
, using the
my_cm
customItems
.
email_mc
class, MovieClip.menu,
entry.
menuItem_cm
. The new menu item is then added
array. Finally, the new menu is
TextField.menu
with a caption of

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?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx

Table of Contents