Flash CS3 Documentation |
|||
| ActionScript 2.0 Components Language Reference > Menu component > Interacting with the Menu component | |||
You can use the mouse and keyboard to interact with a Menu component.
After a Menu component is opened, it remains visible until it is closed by a script or until the user clicks the mouse outside the menu or inside an enabled item.
Clicking selects a menu item, except with the following types of menu items:
Disabled items or separators Rollovers and clicks have no effect (the menu remains visible).
Anchors for a submenu Rollovers activate the submenu; clicks have no effect; rolling onto any item other than those of the submenu closes the submenu.
When an item is selected, a Menu.change event is sent to all of the menu's listeners, the menu is hidden, and the following actions occur, depending on item type:
check The item's selected attribute is toggled.
radio The item becomes the current selection of its radio group.
Moving the mouse triggers Menu.rollOut and Menu.rollOver events.
Pressing the mouse outside the menu closes the menu and triggers a Menu.menuHide event.
Releasing the mouse in an enabled item affects item types in the following ways:
check The item's selected attribute is toggled.
radio The item's selected attribute is set to true, and the previously selected item's selected attribute in the radio group is set to false. The selection property of the corresponding radio group object is set to refer to the selected menu item.
undefined and the parent of a hierarchical menu The visibility of the hierarchical menu is toggled.
When a Menu instance has focus either from clicking or tabbing, you can use the following keys to control it:
|
Key |
Description |
|---|---|
|
Down Arrow Up Arrow |
Moves the selection down and up the rows of the menu. The selection cycles at the top or bottom row. |
|
Right Arrow |
Opens a submenu, or moves selection to the next menu in a menu bar (if a menu bar exists). |
|
Left Arrow |
Closes a submenu and returns focus to the parent menu (if a parent menu exists), or moves selection to the previous menu in a menu bar (if the menu bar exists). |
|
Enter |
Opens a submenu. If a submenu does not exist, this key has the same effect as clicking and releasing on a row. |
|
NOTE |
|
If a menu is opened, you can press the Tab key to move out of the menu. You must either make a selection or dismiss the menu by pressing Escape. |
Flash CS3