User Guide

About menu item types (Flash Professional only) 889
The following example defines three check box menu items:
<menu>
<menuitem label="Apples" type="check" instanceName="buyApples"
selected="true" />
<menuitem label="Oranges" type="check" instanceName="buyOranges"
selected="false" />
<menuitem label="Bananas" type="check" instanceName="buyBananas"
selected="false" />
</menu>
You can use the instance names in ActionScript to access the menu items directly from the
menu itself, as in the following example:
myMenu.setMenuItemSelected(myMenu.buyapples, true);
myMenu.setMenuItemSelected(myMenu.buyoranges, false);
Radio button menu items
Menu items whose type attribute is set to radio can be grouped together so that only one of
the items can be selected at a time. Although a radio button menu item behaves similarly to a
RadioButton component, a radio button menu item appears visually without the border
surrounding the button. So an unselected radio button menu item looks like a Normal menu
item until selected.
You create a radio group by giving the menu items the same value for their
groupName
attribute, as in the following example:
<menu>
<menuitem label="Center" type="radio" groupName="alignment_group"
instanceName="center_item"/>
<menuitem type="separator" />
<menuitem label="Top" type="radio" groupName="alignment_group" />
<menuitem label="Bottom" type="radio" groupName="alignment_group" />
<menuitem label="Right" type="radio" groupName="alignment_group" />
<menuitem label="Left" type="radio" groupName="alignment_group" />
</menu>
NOTE
The selected attribute should be modified only with the setMenuItemSelected() method.
You can directly examine the
selected attribute, but it returns a string value of true or
false.