User Guide

936 Menu component (Flash Professional only)
MenuDataProvider.addMenuItemAt()
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX Professional 2004.
Usage
Usage 1:
myMenuDataProvider.addMenuItemAt(index, initObject)
Usage 2:
myMenuDataProvider.addMenuItemAt(index, childMenuItem)
Parameters
index An integer.
initObject An object containing the specific attributes that initialize a Menu items
attributes. For more information, see About menu item XML attributes” on page 887.
childMenuItem An XML node.
Returns
A reference to the added XML node.
Description
Method; Usage 1 adds a child item at the specified index position in the parent menu item
(which could be the menu itself). The menu item is constructed from the values passed in the
initObject parameter. Usage 2 adds a child item that is defined in the specified XML
childMenuItem parameter to the specified index of a parent menu item.
Any node or menu item in a MenuDataProvider instance can call the methods of the
MenuDataProvider class.
Example
The following example creates a menu with one menu item and then calls the
addMenuItemAt() method to add a second item.