MenuBar.labelField
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX Professional 2004.
Usage
menuBarInstance.labelField
Description
Property; a string that specifies which attribute of each XML node to use as the label text of
the menu. The value of this property is also passed to any menus that are created from the
menu bar. The default value is
.
"label"
After the
property is set, this property is read-only.
dataProvider
Example
The following example specifies that the
attribute of each XML node is to provide the
name
label text for menu items.
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;
//Change label text to be read from "name".
my_mb.labelField = "name";
var my_menu:mx.controls.Menu = my_mb.addMenu({name:"File"});
my_menu.addMenuItem({name:"New", instanceName:"newInstance"});
my_menu.addMenuItem({name:"Open", instanceName:"openInstance"});
962
MenuBar component (Flash Professional only)
Need help?
Do you have a question about the FLASH 8-COMPONENTS LANGUAGE and is the answer not in the manual?
Questions and answers