Description
Property; the data model for items viewed in a list. The value of this property can be an array
or any object that implements the DataProvider API. The default value is
component and the ComboBox component share the
this property are immediately available to both components.
The List component, like other data-aware components, adds methods to the Array object's
prototype so that they conform to the DataProvider API (see DataProvider.as for details).
Therefore, any array that exists at the same time as a list automatically has all the methods
(
,
addItem()
getItemAt()
broadcast model changes to multiple components.
If the array contains objects, the
determine what parts of the item to display. The default value is
it is chosen for display; if not, a comma-separated list of all fields is displayed.
Note: If the array contains strings at each index, and not objects, the list is not able to sort the items
and maintain the selection state. Any sorting will cause the selection to be lost.
Any instance that implements the DataProvider API is eligible as a data provider for a List
component. This includes Flash Remoting RecordSet objects, Firefly DataSet components, and
so on.
Example
This example uses an array of strings to populate the drop-down list:
comboBox.dataProvider = ["Ground Shipping","2nd Day Air","Next Day Air"];
This example creates a data provider array and assigns it to the
myDP = new Array();
list.dataProvider = myDP;
for (var i=0; i<accounts.length; i++) {
// these changes to the DataProvider will be broadcast to the list
myDP.addItem({label: accounts[i].name,
}
ComboBox.dropdown
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX 2004.
Usage
myComboBox.dropdown
, and so on) needed for it to be the model of a list, and can be used to
labelField
data:
accounts[i].accountID});
dataProvider
or
property is accessed to
labelFunction
"label"
dataProvider
. The List
[]
property, and changes to
, so if such a field exists,
property:
ComboBox component
191
Need help?
Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?