ComboBox.value

Availability

Flash Player 6 (6.0.79.0).

Edition

Flash MX 2004.

Usage

comboBoxInstance.value

Description

Read-only property; if the combo box is editable, value returns the item label. If the combo box is static, value returns the item data.

Example

The following example puts the data into the combo box by setting the dataProvider property. It then displays the value in the Output panel. Finally, it selects "California" and displays it in the Output panel while the combo box is editable, and then displays "CA" when the combo box is not editable.

my_cb.dataProvider = [
  {label:"Alaska", data:"AK"},
  {label:"California", data:"CA"},
  {label:"Washington", data:"WA"}];
my_cb.editable = true;
my_cb.selectedIndex = 1;
trace('Editable value is "California": ' + my_cb.value);
my_cb.editable = false;
my_cb.selectedIndex = 1;
trace('Non-editable value is "CA": ' + my_cb.value);