Delegate class

Inheritance Object > Delegate

ActionScript Class Name mx.utils.Delegate

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 ActionScript 2.0 Components), and so that you can call functions within the scope of the containing class.

NOTE

 

The Delegate class is supported only if you are working in a document that specifies ActionScript 2.0 in its Publish Settings.

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 ActionScript 2.0 Components). You can call Delegate.create() to call the function within the scope of the declaring object.

Method summary for the Delegate class

The following table lists the method of the Delegate class.

Method

Description

Delegate.create()

A static method that allows you to run a function in a specific scope.


Flash CS3


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00002893.html