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

10.9. Event Handler Scope

As with any function, the statements in an event handler or listener execute within a predefined scope. Scope dictates where the interpreter looks to resolve unqualified variable references in an event handler's body. We'll consider event handler scope in relation to the four event implementations supported by Flash.

10.9.1. Scope of Event Handler Properties and Event Listener Methods

Event listener methods and event handler properties are scoped exactly as functions are scoped. An event callback function has a scope chain that is defined when the function is defined. Furthermore, event handler properties and event listener methods define a local scope. All the rules of function scope described in Chapter 9 apply to event handler properties and event listener methods.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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