Class com.sekati.utils.Delegate

Description

The Delegate class creates a function wrapper to let you run a function in the context of the original object, rather than in the context of the second object, when you pass a function from one object to another

This customized version allows for function arguments & is repurposed for the framework based on bigspaceships version of adobe/mm'd mx.utils.Delegate.

 Usage:
 myMovieClip.onEnterFrame = Delegate.create(this,_onEnterFrame,"hello world");
 function _onEnterFrame($str:String):Void { trace($str); };
 

Method Index

new Delegate()
create(), createDelegate()

Constructor Detail

Delegate

function Delegate(f:Function)

Constructor

Parameters

f(Function)

Return

Void

Method Detail

create

static function create(obj:Object, func:Function):Function

Creates a functions wrapper for the original function so that it runs in the provided context.

Parameters

obj(Object) Context in which to run the function.
func(Function) Function to run.

Return

Function

createDelegate

function createDelegate(obj:Object):Function

create wrapper

Parameters

obj(Object) Context in which to run the function.

Return

Function