ComboBox.value

Availability

Flash Player 6.0.79.

Edition

Flash MX 2004.

Usage

myComboBox.value

Description

Property (read-only); if the combo box is editable, value returns the value of the text box. If the combo box is static, value returns the value of the drop-down list. The value of the drop-down list is the data field, or, if the data field doesn't exist, the label field.

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 text box, as follows:

cb.dataProvider = [
  {label:"Alaska", data:"AZ"},
  {label:"California", data:"CA"},
  {label:"Washington", data:"WA"}];

cb.editable = true;
cb.selectedIndex = 1;
trace('Editable value is "California": '+ cb.value);

cb.editable = false;
cb.selectedIndex = 1;
trace('Non-editable value is "CA": '+ cb.value);