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.

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:

For more information, see EventDispatcher class.

Example

In the following example, a handler called listener is defined and passed to addEventListener() as the second parameter. The event object is captured by the modelChanged handler in the evt parameter. When the modelChanged event is broadcast, a trace statement is sent to the Output panel.

listener = new Object();
listener.modelChanged = function(evt){
    trace(evt.eventName);
}
myList.addEventListener("modelChanged", listener);