User Guide

Using the ComboBox component 159
For more information about controlling focus, see “FocusManager class” on page 721 or
“Creating custom focus navigation” in Using Components.
A live preview of each ComboBox component instance on the Stage reflects changes made to
parameters in the Property inspector or Component inspector during authoring. However,
the drop-down list does not open in the live preview, and the first item is displayed as the
selected item.
When you add the ComboBox component to an application, you can use the Accessibility
panel to make it accessible to screen readers. First, you must add the following line of code to
enable accessibility:
mx.accessibility.ComboBoxAccImpl.enableAccessibility();
You enable accessibility for a component only once, regardless of how many instances the
component has. For more information, see Chapter 19, “Creating Accessible Content,in
Using Flash.
Using the ComboBox component
You can use a ComboBox component in any form or application that requires a single choice
from a list. For example, you could provide a drop-down list of states in a customer address
form. You can use an editable combo box for more complex scenarios. For example, in an
application that provides driving directions, you could use an editable combo box for a user to
enter her origin and destination addresses. The drop-down list would contain her previously
entered addresses.
ComboBox parameters
You can set the following authoring parameters for each ComboBox component instance in
the Property inspector or in the Component inspector (Window > Component Inspector
menu option):
data associates a data value with each item in the ComboBox component. The data parameter
is an array.
editable determines if the ComboBox component is editable (true) or only selectable
(
false). The default value is false.
labels populates the ComboBox component with an array of text values.
rowCount sets the maximum number of items that can be displayed in the list. The default
value is 5.