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:
editable
determines if the ComboBox component is editable (
The default value is
labels
populates the ComboBox component with an array of text values.
data
associates a data value with each item in the ComboBox component. The data parameter is
an array.
rowCount
sets the maximum number of items that can be displayed in the list. The default value
is 5.
You can write ActionScript to set additional options for ComboBox instances using the methods,
properties, and events of the ComboBox class. For more information, see
on page
182.
Creating an application with the ComboBox component
The following procedure explains how to add a ComboBox component to an application
while authoring. In this example, the combo box presents a list of cities to select from in its
drop-down list.
To create an application with the ComboBox component:
Drag a ComboBox component from the Components panel to the Stage.
1.
Select the Transform tool and resize the component on the Stage.
2.
The combo box can only be resized on the Stage during authoring. Typically, you would only
change the width of a combo box to fit its entries.
Select the combo box and, in the Property inspector, enter the instance name comboBox.
3.
In the Component inspector or Property inspector, do the following:
4.
Enter Minneapolis, Portland, and Keene for the label parameter. Double-click the label
parameter field to open the Values dialog box. Then click the plus sign to add items.
Enter MN.swf, OR.swf, and NH.swf for the data parameter.
These are imaginary SWF files that, for example, you could load when a user selects a city
from the combo box.
178
Chapter 6: Components Dictionary
.
false
) or only selectable (
true
"ComboBox class"
).
false
Need help?
Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?