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

Chapter 10. Handling Events > Using the Delegate class

Using the Delegate class

The Delegate class lets you run a function in a specific scope. This class is provided so that you can dispatch the same event to two different functions (see “Delegating events to functions” in Using Components in Flash Help), and so that you can call functions within the scope of the containing class.

When you pass a function as a parameter to EventDispatcher.addEventListener(), the function is invoked in the scope of the broadcaster component instance, not the object in which it is declared (see “Delegating the scope of a function” in Using Components in Flash Help). You can use Delegate.create() to call the function within the scope of the declaring object.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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