CHAPTER 30
30
Menu component (Flash
Professional only)
The Menu component lets a user select an item from a pop-up menu, much like the File or
Edit menu of most software applications.
A Menu component usually opens in an application when a user rolls over or clicks a button-
like menu activator. You can also script a Menu component to open when a user presses a
certain key.
Menu components are always created dynamically at runtime. You drag the component from
the Components panel to the library, and then use the following code to create a menu with
ActionScript:
var myMenu = mx.controls.Menu.createMenu(parent, menuDataProvider);
Use the following code to open a menu in an application:
myMenu.show(x, y);
A
event is broadcast to all of the Menu instance's listeners immediately before the
menuShow
menu is rendered, so you can update the state of the menu items. Similarly, immediately after
a Menu instance is hidden, a
event is broadcast.
menuHide
The items in a menu are described by XML. For more information, see
"Understanding the
Menu component: view and data" on page
886.
You cannot make the Menu component accessible to screen readers.
Menus are often nested within menu bars. For information about menu bars, see
"MenuBar
component (Flash Professional only)" on page
945.
883
Need help?
Do you have a question about the FLASH 8-COMPONENTS LANGUAGE and is the answer not in the manual?
Questions and answers