User Guide

Menu component (Flash Professional only) 555
Usage
Usage 1:
myMenu.addMenuItem(initObject)
Usage 2:
myMenu.addMenuItem(childMenuItem)
Parameters
initObject
An object containing properties that initialize a menu items attributes. See About
menu item XML attributes” on page 541.
childMenuItem An XML node object.
Returns
A reference to the added XML node.
Description
Method; Usage 1 adds a menu item at the end of the menu. The menu item is constructed from
the values supplied in the
initObject parameter. Usage 2 adds a menu item that is a prebuilt
XML node (in the form of an XML object) at the end of the menu. Adding a preexisting node
removes the node from its previous location.
Example
Usage 1: The following example appends a menu item to a menu:
myMenu.addMenuItem({label:"Item 1", type:"radio", selected:false,
enabled:true, instanceName:"radioItem1", groupName:"myRadioGroup"});
Usage 2: The following example moves a node from one menu to the root of another menu:
myMenu.addMenuItem(mySecondMenu.getMenuItemAt(3));
Menu.addMenuItemAt()
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX Professional 2004.
Usage
Usage 1:
myMenu.addMenuItemAt(index, initObject)
Usage 2:
myMenu.addMenuItemAt(index, childMenuItem)