ComboBox class
Inheritance
MovieClip >
ActionScript Class Name
The ComboBox component combines three separate subcomponents: Button, TextInput, and
List. Most of the methods, properties, and events of each subcomponent are available directly
from the ComboBox component and are listed in the summary tables for the ComboBox class.
The drop-down list in a combo box is provided either as an array or as a data provider. If you use
a data provider, the list changes at runtime. You can change the source of the ComboBox data
dynamically by switching to a new array or data provider.
Items in a combo box list are indexed by position, starting with the number 0. An item can be one
of the following:
•
A primitive data type.
•
An object that contains a
Note: An object may use the
determine the
If the item is a primitive data type other than String, it is converted to a string. If an item is an
object, the
label
ComboBox methods to which you supply items have two parameters,
to the properties above. Methods that return an item return it as an object.
A combo box defers the instantiation of its drop-down list until a user interacts with it. Therefore,
a combo box may appear to respond slowly on first use.
Use the following code to programmatically access the ComboBox component's drop-down list
and override the delay:
var foo = myComboBox.dropdown;
Accessing the drop-down list may cause a pause in the application. This may occur when the user
first interacts with the combo box, or when the above code runs.
Method summary for the ComboBox class
The following table lists methods of the ComboBox class.
Method
ComboBox.addItem()
ComboBox.addItemAt()
ComboBox.close()
ComboBox.getItemAt()
ComboBox.open()
ComboBox.removeAll()
182
Chapter 6: Components Dictionary
UIObject class
mx.controls.ComboBox
property and a
label
ComboBox.labelFunction
property.
label
property must be a string and the
Description
Adds an item to the end of the list.
Adds an item to the end of the list at the specified index.
Closes the drop-down list.
Returns the item at the specified index.
Opens the drop-down list.
Removes all items in the list.
>
UIComponent class
property
data
or
ComboBox.labelField
property can be any ActionScript value.
data
> ComboBase > ComboBox
property to
and
, that refer
label
data
Need help?
Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?
Questions and answers