User Guide

910 Menu component (Flash Professional only)
// Add the menu items.
menuDP_obj.addMenuItem({label:"1st Item"});
menuDP_obj.addMenuItem({label:"2nd Item"});
// Create the Menu object.
var my_menu:Menu = Menu.createMenu(this, menuDP_obj);
my_menu.show();
var menuListener:Object = new Object();
menuListener.change = function(evt_obj:Object) {
trace("Menu item chosen: " + evt_obj.menuItem.attributes.label);
};
my_menu.addEventListener("change", menuListener);
Menu.createMenu()
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX Professional 2004.
Usage
Menu.createMenu([parent [, mdp]])
Parameters
parent A MovieClip instance. The movie clip is the parent component that contains the
new Menu instance. This parameter is optional.
mdp The MenuDataProvider instance that describes this Menu instance. This parameter
is optional.
Returns
A reference to the new menu instance.
Description
Method (static); instantiates a Menu instance, and optionally attaches it to the specified
parent, with the specified MenuDataProvider as the data source for the menu items.
If the
parent parameter is omitted or null, the Menu is attached to the _root timeline.
If the mdp parameter is omitted or null, the menu does not have any items; you must call
addMenu() or setDataProvider() to populate the menu.