Condividi tramite


Type.createDelegate Method

Creates a delegate function that keeps the context from its creation. The context defines the object instance to which the this keyword points.

public static function createDelegate(
    instance : Object,
    method : Function
) : Function

Parameters

Parameter

Description

instance

The object instance that will be the context for the function. This parameter can be null.

method

The function from which the delegate is created.

Return Value

The delegate function.

Remarks

Use this method to set up an event handler to point to an object method that must use the this pointer from within its scope.

See Also

Reference

Type Class