// 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
A MovieClip instance. The movie clip is the parent component that contains the
parent
new Menu instance. This parameter is optional.
The MenuDataProvider instance that describes this Menu instance. This parameter
mdp
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
parameter is omitted or null, the Menu is attached to the
parent
If the
parameter is omitted or null, the menu does not have any items; you must call
mdp
or
addMenu()
setDataProvider()
910
Menu component (Flash Professional only)
to populate the menu.
timeline.
_root
Need help?
Do you have a question about the FLASH 8-COMPONENTS LANGUAGE and is the answer not in the manual?
Questions and answers