O'Reilly logo

Flash 8 Cookbook by Joey Lott

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

13.3. Adding a Menu Form Control

Problem

You want to add a form control that allows the user to select a value or values from a menu.

Solution

Use a ComboBox or List component.

Discussion

The ComboBox and List components provide you with a simple way to add menu form controls to your Flash application. Flash Professional includes a Menu component that requires some slightly more advanced ActionScript than this book discusses, but for the purposes of this discussion, the term “menu” is meant in a general sense. Combo boxes are often referred to in laymen’s terms as drop-down or pop-up menus. A combo box will display only one menu item at a time, though you can open and close the menu to display more items at once. A user can select only one item at a time from a combo box. A list, on the other hand, cannot be opened and closed, but instead displays multiple selections at the same time. If the list contains too many items to fit within the vertical space, the list will be made scrollable. Though lists allow a user to select only one item at a time by default, it is possible to enable them to accept multiple selections.

You can add either a combo box or a list component by dragging an instance from the Components panel onto the stage. After you’ve created the instance, you should be sure to give it an instance name using the Property inspector. The instance name provides the way in which you can later retrieve the selected value or values from the menu form control.

The next thing you should ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required