Normal menu items
The
Normal Item
defaults to
normal
on whether they have nested subitems.
Separator menu items
A menu item whose
The following XML creates three menu items, Top, Middle, and Bottom, with separators
between them:
<menu>
<menuitem label="Top" />
<menuitem type="separator" />
<menuitem label="Middle" />
<menuitem type="separator" />
<menuitem label="Bottom" />
</menu>
All separator items are disabled. Clicking on or rolling over a separator has no effect.
Check box menu items
A menu item whose
attribute is set to
selected
check box item is selected, its state automatically toggles, and a
listeners on the root menu. 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);
Note: The
selected
can directly examine the
542
Chapter 6: Components Dictionary
menu item doesn't have a
. Normal items can be command activators or submenu activators, depending
attribute is set to
type
attribute is set to
type
, a check mark appears beside the menu item's label. When a
true
attribute should be modified only with the
attribute, but it returns a string value of
selected
attribute, which means that the
type
acts as a visual divider in a menu.
separator
acts as check box item in the menu; when the
check
change
setMenuItemSelected()
attribute
type
event is broadcast to all
method. You
or
.
true
false
Need help?
Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?
Questions and answers