802
Object-Oriented Programming with ActionScript 1.0
To invoke a function using the Function.call() method:
■
Use the following syntax:
myFunction
.call(
thisObject
,
parameter1
, ...,
parameterN
)
The method takes the following parameters:
■
The parameter
thisObject
specifies the value of
this
within the function body.
■
The parameters
parameter1
...,
parameterN
specify parameters to be passed to
myFunction
. You can specify zero or more parameters.
Specifying the object to which a function is applied
using Function.apply() in ActionScript 1.0
The
Function.apply()
method specifies the value of
this
to be used within any function
that ActionScript calls. This method also specifies the parameters to be passed to any
called function.
The parameters are specified as an Array object. This is often useful when the number of
parameters to be passed is not known until the script actually executes.
For more information, see
apply (Function.apply method)
in the
ActionScript 2.0
Language Reference.
To specify the object to which a function is applied using Function.apply():
■
Use the following syntax:
myFunction
.apply(
thisObject
,
argumentsObject
)
The method takes the following parameters:
■
The parameter
thisObject
specifies the object to which
myFunction
is applied.
■
The parameter
argumentsObject
defines an array whose elements are passed to
myFunction
as parameters.
NO
TE
Many Flash users can greatly benefit from using ActionScript 2.0, especially with
complex applications. For information on using ActionScript 2.0, see
Chapter 7,
“Classes,” on page 225
.
Содержание FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
Страница 1: ...Learning ActionScript 2 0 in Flash...
Страница 8: ...8 Contents...
Страница 18: ...18 Introduction...
Страница 30: ...30 What s New in Flash 8 ActionScript...
Страница 66: ...66 Writing and Editing ActionScript 2 0...
Страница 328: ...328 Interfaces...
Страница 350: ...350 Handling Events...
Страница 590: ...590 Creating Interaction with ActionScript...
Страница 710: ...710 Understanding Security...
Страница 730: ...730 Debugging Applications...
Страница 780: ...780 Deprecated Flash 4 operators...
Страница 830: ...830 Index...