User Guide
DataProvider API 295
DataProvider.length
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX Professional 2004.
Usage
myDP.length
Description
Property (read-only); the number of items in the data provider.
Example
This example sends the number of items in the myArray data provider to the Output panel:
trace(myArray.length);
DataProvider.modelChanged
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX Professional 2004.
Usage
listenerObject = new Object();
listenerObject.modelChanged = function(eventObject){
// insert your code here
}
myMenu.addEventListener("modelChanged", listenerObject)
Description
Event; broadcast to all of its view listeners whenever the data provider is modified. You typically
add a listener to a model by assigning its
dataProvider property.
Version 2 components use a dispatcher/listener event model. When a data provider changes in
some way, it broadcasts a
modelChanged event, and data-aware components catch it to update
their displays to reflect the changes in data.
The
Menu.modelChanged event’s event object has five additional properties:
• eventName The eventName property is used to subcategorize modelChanged events.
Data-aware components use this information to avoid completely refreshing the component
instance (view) that is using the data provider. The
eventName property supports the following
values:
■ updateAll The entire view needs refreshing, excluding scroll position.
■ addItems A series of items has been added.