MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual page 463

Using components
Hide thumbs Also See for FLASH MX 2004-USING COMPONENTS:
Table of Contents

Advertisement

Example
The following example sends the instance name of the component that generated the
event to the Output panel:
form.change = function(eventObj){
trace("Value changed to " + eventObj.target.value);
}
myList.addEventListener("change", form);
See also
EventDispatcher.addEventListener()
List.dataProvider
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX 2004.
Usage
listinstance.dataProvider
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
see
"DataProvider API" on page
The List component, like other data-aware components, adds methods to the Array object's
prototype so that they conform to the DataProvider API. Therefore, any array that exists at the
same time as a list automatically has all the methods (
it needs to be the data model for the list, and can be used to broadcast model changes to
multiple components.
If the array contains objects, the
accessed to determine what parts of the item to display. The default value is
field exists, it is chosen for display; if it doesn't exist, a comma-separated list of all fields
label
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 can be a data provider for a List component.
This includes Flash Remoting recordsets, Firefly data sets, and so on.
Example
This example uses an array of strings to populate the list:
list.dataProvider = ["Ground Shipping","2nd Day Air","Next Day Air"];
464
Chapter 6: Components Dictionary
290.
addItem()
or
List.labelField
. For more information,
[]
,
getItemAt()
List.labelFunction
"label"
change
, and so on)
properties are
, so if a

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flash mx

Table of Contents