User Guide
938 Menu component (Flash Professional only)
MenuDataProvider.getMenuItemAt()
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX Professional 2004.
Usage
myMenuDataProvider.getMenuItemAt(index)
Parameters
index An integer indicating the position of the menu.
Returns
A reference to the specified XML node.
Description
Method; returns a reference to the specified child menu item of the current 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, adds a menu item to it, and then calls the
getMenuItemAt() method to access its node object for the purpose of adding a submenu
item to it. It also calls the
getMenuItemAt() method to display the label of the submenu item
in the Output panel.
You first drag a Menu component to the library and then add the following code to Frame 1:
/**
Requires:
- Menu component in library
*/
import mx.controls.Menu;
// Create an XML object to act as a factory.
var my_xml:XML = new XML();
// The item created next does not appear in the menu.
// The createMenu() method call (below) expects to
// receive a root element whose children will become
// the items. This is just a simple way to create that