Learning ActionScript 2.0 in Adobe Flash |
|
||
| Object-Oriented Programming with ActionScript 1.0 > Using Function object properties in ActionScript 1.0 > Specifying the object to which a function is applied using Function.apply() in ActionScript 1.0 | |||
|
NOTE |
Many Flash users can greatly benefit from using ActionScript 2.0, especially with complex applications. For information on using ActionScript 2.0, see Classes. |
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():myFunction.apply(thisObject,argumentsObject)
The method takes the following parameters:
thisObject specifies the object to which myFunction is applied.argumentsObject defines an array whose elements are passed to myFunction as parameters.
|
|
||