MenuBar.getMenuEnabledAt()
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX Professional 2004.
Usage
menuBarInstance.getMenuEnabledAt(index)
Parameters
The index of the menu in the menu bar.
index
Returns
A Boolean value that indicates whether this menu can be chosen (
) or not (
).
true
false
Description
Method; returns a Boolean value that indicates whether this menu can be chosen (
) or
true
not (
).
false
Example
The following example creates a File menu with two menu items and then calls
with a value of
to disable it. It also calls
setMenuEnabledAt()
false
getMenuEnabledAt()
and displays the result to show you how to determine whether a menu is enabled.
Drag an instance of the MenuBar component onto the Stage, and enter the instance name
in the Property inspector. Add the following code to Frame 1 of the timeline:
my_mb
/**
Requires:
- MenuBar component on Stage (instance name: my_mb)
*/
var my_mb:mx.controls.MenuBar;
var my_menu:mx.controls.Menu = my_mb.addMenu("File");
my_menu.addMenuItem({label:"New", instanceName:"newInstance"});
my_menu.addMenuItem({label:"Open", instanceName:"openInstance"});
//Disable "file" menu.
my_mb.setMenuEnabledAt(0, false);
//Check if "file" menu can be selected.
trace("Menu can be selected: " + my_mb.getMenuEnabledAt(0));
MenuBar.getMenuEnabledAt()
961
Need help?
Do you have a question about the FLASH 8-COMPONENTS LANGUAGE and is the answer not in the manual?
Questions and answers