When the user selects one of the items, the current selection automatically changes, and a
event is broadcast to all listeners on the root menu. The currently selected item in a
change
radio group is available in ActionScript through the
var selectedMenuItem = myMenu.alignment_group.selection;
myMenu.alignment_group = myMenu.center_item;
Each
value must be unique within the scope of the root menu instance.
groupName
The
attribute should be modified only with the
selected
You can directly examine the
or
.
false
Exposing menu items to ActionScript
You can assign each menu item a unique identifier in the
makes the menu item accessible directly from the root menu. For example, the following
XML code provides
instanceName
<menu>
<menuitem label="Item 1" instanceName="item_1" />
<menuitem label="Item 2" instanceName="item_2" >
<menuitem label="SubItem A" instanceName="sub_item_A" />
<menuitem label="SubItem B" instanceName="sub_item_B" />
</menuitem>
</menu>
You can use ActionScript to access the corresponding instances and their attributes directly
from the menu component, as follows:
var aMenuItem = myMenu.item_1;
myMenu.setMenuItemEnabled(item_2, true);
var aLabel = myMenu.sub_item_A.attributes.label;
Each instanceName attribute must be unique within the scope of the root menu
component instance (including all of the submenus of root).
890
Menu component (Flash Professional only)
selection
attribute, but it returns a string value of
selected
attributes for each menu item:
property, as follows:
setMenuItemSelected()
attribute, which
instanceName
method.
true
Need help?
Do you have a question about the FLASH 8-COMPONENTS LANGUAGE and is the answer not in the manual?