MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual page 387

Using components
Hide thumbs Also See for FLASH MX 2004-USING COMPONENTS:
Table of Contents

Advertisement

Delegate class
Inheritance
Object > Delegate
ActionScript Class Name
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
on page
63), and so that you can call functions within the scope of the containing class.
When you pass a function as a parameter to
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" on page
Delegate.create()
Method summary for the Delegate class
The following table lists the method of the Delegate class.
Property
Delegate.create()
Delegate.create()
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX Professional 2004.
Usage
Delegate.create(scopeObject, function)
Parameters
A reference to an object. This is the scope in which to run the function.
scopeObject
A reference to a function.
function
Description
Method (static); allows you to delegate events to specific scopes and functions. Use the following
syntax:
import mx.utils.Delegate;
compInstance.addEventListener("eventName", Delegate.create(scopeObject,
function));
The
scopeObject
Example
For examples of
388
Chapter 6: Components Dictionary
mx.utils.Delegate
to call the function within the scope of the declaring object.
Description
A static method that allows you to run a function in a specific scope.
parameter specifies the scope in which the specified function is called.
, see
Delegate.create()
Components Dictionary
"Delegating events to functions"
EventDispatcher.addEventListener()
65). You can call
"Delegating events" on page
CHAPTER 6
, the
63.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash mx

Table of Contents