MenuBar component

The MenuBar component lets you create a horizontal menu bar with pop-up menus and commands, just like the menu bars that contain File and Edit menus in common software applications. The MenuBar component complements the Menu component by providing a clickable interface to show and hide menus that behave as a group for mouse and keyboard interactivity.

NOTE

 

The MenuBar component is supported only if you are working in a document that specifies ActionScript 2.0 in its Publish Settings.

The MenuBar component lets you create an application menu in a few steps. To build a menu bar, you can either assign an XML data provider to the menu bar that describes a series of menus, or use the MenuBar.addMenu() method to add menu instances one at a time.

Each menu in the menu bar is composed of two parts: the menu and the button that causes the menu to open (called the menu activator). These clickable menu activators appear in the menu bar as a text label with inset and outset border highlight states that react to interaction from the mouse and keyboard.

When a menu activator is clicked, the corresponding menu opens below it. The menu stays active until the activator is clicked again, or until a menu item is selected or a click occurs outside the menu area.

In addition to creating menu activators that show and hide menus, the MenuBar component creates group behavior among a series of menus. This lets a user scan a large number of command choices by rolling over the series of activators or by using the arrow keys to move through the lists. Mouse and keyboard interactivity work together to let the user jump from menu to menu in the menu bar.

A user cannot scroll through menus on a menu bar. If menus exceed the width of the menu bar, they are masked.

You cannot make the MenuBar component accessible to screen readers.

Menus are often nested within menu bars. For information about menus, see Menu component.

Related topics


Flash CS3