User Guide
966 MenuBar component (Flash Professional only)
Drag an instance of the MenuBar component onto the Stage, and enter the instance name
my_mb in the Property inspector. Add the following code to Frame 1 of the timeline:
/**
Requires:
- MenuBar component on Stage (instance name: my_mb)
*/
import mx.controls.Menu;
import mx.controls.MenuBar;
var my_mb:MenuBar;
var file_menu:Menu = my_mb.addMenu("File");
file_menu.addMenuItem({label:"New", instanceName:"newInstance"});
file_menu.addMenuItem({label:"Open", instanceName:"openInstance"});
var edit_menu:Menu = my_mb.addMenu("Edit");
edit_menu.addMenuItem({label:"Cut", instanceName:"cutInstance"});
edit_menu.addMenuItem({label:"Copy", instanceName:"copyInstance"});
edit_menu.addMenuItem({label:"Paste", instanceName:"pasteInstance"});
//Delete "file" menu.
my_mb.removeMenuAt(0);
MenuBar.setMenuEnabledAt()
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX Professional 2004.
Usage
menuBarInstance.setMenuEnabledAt(index, boolean)
Parameters
index The index of the menu item to set in the MenuBar instance.
boolean A Boolean value indicating whether the menu item at the specified index is
enabled (
true) or not (false).
Returns
Nothing.