ComboBox.selectedItem
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX 2004.
Usage
comboBoxInstance.selectedItem
Description
Property; the value of the selected item in the drop-down list.
If the combo box is editable,
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
valid; it returns
undefined
Example
With a ComboBox component instance
the
data and label properties:
selectedItem
// Add Items to List.
my_cb.addItem({data:1, label:"First Item"});
my_cb.addItem({data:2, label:"Second Item"});
my_cb.addItem({data:3, label:"Third Item"});
my_cb.addItem({data:4, label:"Fourth Item"});
var cbListener:Object = new Object();
cbListener.change = function(evt_obj:Object) {
var item_obj:Object = my_cb.selectedItem;
var i:String;
for (i in item_obj) {
trace(i + ":\t" + item_obj[i]);
}
trace("");
};
my_cb.addEventListener("change", cbListener);
See also
ComboBox.dataProvider
200
ComboBox component
returns
selectedItem
if there are no items in the list.
my_cb
,
ComboBox.selectedIndex
if the user enters any text in
undefined
, the following example shows the values for
is always
selectedItem
Need help?
Do you have a question about the FLASH 8-COMPONENTS LANGUAGE and is the answer not in the manual?
Questions and answers