User Guide
MenuBar component (Flash Professional only) 581
Events inherited from the UIComponent class
The following table lists the events the MenuBar class inherits from the UIComponent class.
When calling these events from the MenuBar object, use the form
MenuBar.eventName.
MenuBar.addMenu()
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX Professional 2004.
Usage
Usage 1:
myMenuBar.addMenu(label)
Usage 2:
myMenuBar.addMenu(label, menuDataProvider)
Parameters
label
A string indicating the label of the new menu.
menuDataProvider An XML or XMLNode instance that describes the menu and its items. If
the value is an XML instance, the instance’s first child is used.
Returns
A reference to the new Menu object.
Description
Method; Usage 1 adds a single menu and menu activator at the end of the menu bar and uses the
specified label. Usage 2 adds a single menu and menu activator that are defined in the specified
XML
menuDataProvider parameter.
Example
Usage 1: The following example adds a File menu and then uses Menu.addMenuItem() to add the
menu items New and Open:
var myMenuBar:mx.controls.MenuBar;
var myMenu:mx.controls.Menu;
Event Description
UIComponent.focusIn Broadcast when an object receives focus.
UIComponent.focusOut Broadcast when an object loses focus.
UIComponent.keyDown Broadcast when a key is pressed.
UIComponent.keyUp Broadcast when a key is released.