• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 10. Events and Event Handling > Values of the this Keyword

10.10. Values of the this Keyword

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.
Button with event handler property The button that defines the handler property.
Button with on( ) handler The clip on whose timeline the button resides.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint