User Guide
ComboBox component 207
See also
ComboBox.selectedItem
ComboBox.selectedItem
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX 2004.
Usage
myComboBox.selectedItem
Description
Property; the value of the selected item in the drop-down list.
If the combo box is editable,
selectedItem returns undefined if the user enters any text in the
text box. The property only has a value if you select an item from the drop-down list or set the
value using ActionScript. If the combo box is static, the value of
selectedItem is always valid; it
returns
undefined if there are no items in the list.
Example
The following example shows selectedItem if the data provider contains primitive types:
var item = myComboBox.selectedItem;
trace("You selected the item " + item);
The following example shows selectedItem if the data provider contains objects with label and
data properties:
var obj = myComboBox.selectedItem;
trace("You have selected the color named: " + obj.label);
trace("The hex value of this color is: " + obj.data);
See also
ComboBox.dataProvider
, ComboBox.selectedIndex
ComboBox.sortItems()
Availability
Flash Player 7.
Edition
Flash MX Professional 2004.
Usage
myComboBox.sortItems([compareFunc], [optionsFlag])