Using Objects in ActionScript > Controlling classes or methods with Function object properties > Specifying the object to which a function is applied using the Function.apply method |  |

Specifying the object to which a function is applied using the Function.apply method

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 `Function.apply` in the ActionScript Dictionary.

To specify the object to which a function is applied using the Function.apply method:

Use the following syntax:

    myFunction.apply(thisObject, argumentsObject)

The method takes the following parameters:

| The parameter `thisObject` specifies the object that `myFunction` is applied to.
| The parameter `argumentsObject` defines an array whose elements are passed to `myFunction` as parameters.