ActionScript for Flash MX: The Definitive Guide, 2nd Edition By Colin Moock
Chapter 10. Events and Event Handling
In our study of ActionScript's event handling tools, we've encountered the this keyword several times. Within an event handler, this normally refers to the object that received notification of the event. However, Flash's evolution through multiple event systems has complicated the issue. Table 10-2 provides a guide to the values of the this keyword in ActionScript's various event handling mechanisms.
Table 10-2. Values of the this keyword
Event handling mechanism
Value of this
Event handler property
The object that defines the handler property.
Event listener method
The object registered as a listener.
MovieClip with event handler property
The movie clip that defines the handler property.
MovieClip with on( ) handler
The clip that bears the handler in the authoring tool.
MovieClip with onClipEvent( ) handler
The clip that bears the handler in the authoring tool.