MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual page 266

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

Advertisement

trace("The cell at " + cell + " has been clicked");
};
grid.addEventListener("cellPress", myListener);
DataGrid.change
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX Professional 2004.
Usage
listenerObject = new Object();
listenerObject.change = function(eventObject){
// insert your code here
}
myDataGridInstance.addEventListener("change", listenerObject)
Description
Event; broadcast to all registered listeners when an item has been selected.
Version 2 components use a dispatcher/listener event model. When a DataGrid component
dispatches a
change
attached to a listener object (
addEventListener()
When the event is triggered, it automatically passes an event object (
handler. Each event object has properties that contain information about the event. You can use
these properties to write code that handles the event. The
has one additional property,
"EventDispatcher class" on page
Example
In the following example, a handler called
grid.addEventListener()
handler in the
eventObject
is sent to the Output panel.
var myListener = new Object();
myListener.change = function(event) {
trace("The selection has changed to " + event.target.selectedIndex);
};
grid.addEventListener("change", myListener);
266
Chapter 6: Components Dictionary
event, the event is handled by a function (also called a handler) that is
listenerObject
method and pass it the name of the handler as a parameter.
, whose value is
type
415.
as the second parameter. The event object is captured by
parameter. When the
) that you create. You call the
DataGrid.change
. For more information, see
"change"
is defined and passed to
myListener
event is broadcast, a
change
) to the
eventObject
event's event object
change
statement
trace

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx

Table of Contents