This example creates a data provider array and assigns it to the
the following:
var myDP_array:Array = new Array();
my_list.dataProvider = myDP_array;
var accounts_array:Array = new Array();
accounts_array.push({name:"checkings", accountID:12345});
accounts_array.push({name:"savings", accountID:67890});
for (var i:Number = 0; i < accounts_array.length; i++) {
// These changes to the data provider will be broadcast to the list.
myDP_array.addItem({label:accounts_array[i].name,
data:accounts_array[i].accountID});
}
List.getItemAt()
Availability
Flash Player 6 (6.0.79.0).
Edition
Flash MX 2004.
Usage
listInstance.getItemAt(index)
Parameters
A number greater than or equal to 0, and less than
index
index of the item to retrieve.
Returns
The indexed item object;
Description
Method; retrieves the item at the specified index. This method gets the data item either from
an array, DataProvider, or from a data object created with
if the index is out of range.
undefined
property, as in
dataProvider
. It specifies the
List.length
CellRenderer.setValue()
List.getItemAt()
.
781
Need help?
Do you have a question about the FLASH 8-COMPONENTS LANGUAGE and is the answer not in the manual?
Questions and answers