User Guide

ComboBox component 179
5.
Select Frame 1 in the Timeline, open the Actions panel, and enter the following code:
function change(evt){
trace(evt.target.selectedItem.label);
}
comboBox.addEventListener("change", this);
The last line of code adds a change event handler to the ComboBox instance. For more
information, see
ComboBox.change.
Customizing the ComboBox component
You can transform a ComboBox component horizontally and vertically while authoring. While
authoring, select the component on the Stage and use the Free Transform tool or any of the
Modify > Transform commands.
If text is too long to fit in the combo box, the text is clipped to fit. You must resize the combo box
while authoring to fit the label text.
In editable combo boxes, only the button is the hit area—not the text box. For static combo
boxes, the button and the text box constitute the hit area. The hit area responds by opening or
closing the drop-down list.
Using styles with the ComboBox component
You can set style properties to change the appearance of a ComboBox component. If the name of
a style property ends in “Color”, it is a color style property and behaves differently than noncolor
style properties. For more information, see “Using styles to customize component color and text
on page 67.
The combo box has two unique styles:
openDuration and openEasing. Other styles are passed
to the button, text box, and drop-down list of the combo box through those individual
components, as follows:
The button is a Button instance and uses its styles. (See “Using styles with the Button
component” on page 133.)
The text is a TextInput instance and uses its styles. (See “Using styles with the TextInput
component” on page 744.)
The drop-down list is an List instance and uses its styles. (See “Using styles with the List
component” on page 453.)
A ComboBox component uses the following styles:
Style Theme Description
themeColor
Halo The base color scheme of a component. Possible values are
"haloGreen", "haloBlue", and "haloOrange". The default value
is
"haloGreen".
backgroundColor
Both The background color. The default color is white.