| Package | vegas.events |
| Class | public class Delegate |
| Inheritance | Delegate CoreObject |
| Implements | EventListener, ICloneable, IRunnable |
This version is also inspired from Peter Hall's EventDelegate implementation and from the Francis bourre framework "Pixlib".
You can instantiate and keep a reference of a Delegate instance.
In the VEGAS implementation :
Delegate class implements EventListener interface. you can use a Delegate instances in the addEventListener method for all EventTarget implementations.Delegate class implements IRunnable interface| Method | Defined by | ||
|---|---|---|---|
|
Delegate(scope:*, method:Function, ... arguments)
Creates a new Delegate instance.
| Delegate | ||
|
addArguments(... arguments):void
Adds arguments to proxy method.
| Delegate | ||
|
clone():*
Returns a shallow copy of the instance.
| Delegate | ||
|
create(scope:*, method:Function, ... arguments):Function
[static]
Creates a method that delegates its arguments to a specified scope.
| Delegate | ||
|
getArguments():Array
Returns the array of all arguments called in the proxy method.
| Delegate | ||
![]() |
Returns the internal
ILogger reference of this ILogable object. | CoreObject | |
|
getMethod():Function
Returns the proxy method reference.
| Delegate | ||
|
getScope():*
Returns the scope reference.
| Delegate | ||
|
handleEvent(e:Event):void
Handles the event.
| Delegate | ||
![]() |
hashCode():uint
Returns a hashcode value for the object.
| CoreObject | |
|
run(... arguments):void
Run the proxy method in the provided context.
| Delegate | ||
|
setArguments(... arguments):void
Sets or change arguments of proxy method.
| Delegate | ||
![]() |
Sets the internal
ILogger reference of this ILogable object. | CoreObject | |
![]() |
toSource(indent:int = 0):String
Returns the string representation the source code of the object.
| CoreObject | |
![]() |
toString():String
Returns the string representation of this instance.
| CoreObject | |
| Delegate | () | constructor |
public function Delegate(scope:*, method:Function, ... arguments)Creates a new Delegate instance.
Parametersscope:* — the scope to be used by calling this method.
|
|
method:Function — the method to be executed.
|
|
... arguments — the optional argument to pass in the method.
|
| addArguments | () | method |
public function addArguments(... arguments):voidAdds arguments to proxy method.
Parameters... arguments |
| clone | () | method |
public function clone():*Returns a shallow copy of the instance.
Returns* — a shallow copy of the instance.
|
| create | () | method |
public static function create(scope:*, method:Function, ... arguments):FunctionCreates a method that delegates its arguments to a specified scope. This static method is a wrapper for MM compatibility.
Parametersscope:* — this scope to be used by calling this method.
|
|
method:Function — the method to be called.
|
|
... arguments |
Function — a Function that delegates its call to a custom scope, method and arguments.
|
| getArguments | () | method |
public function getArguments():ArrayReturns the array of all arguments called in the proxy method.
ReturnsArray — the array of all arguments called in the proxy method.
|
| getMethod | () | method |
public function getMethod():FunctionReturns the proxy method reference.
ReturnsFunction — the proxy method reference.
|
| getScope | () | method |
public function getScope():*Returns the scope reference.
Returns* — the scope reference.
|
| handleEvent | () | method |
public function handleEvent(e:Event):voidHandles the event.
Parameterse:Event |
| run | () | method |
public function run(... arguments):voidRun the proxy method in the provided context.
Parameters... arguments |
| setArguments | () | method |
public function setArguments(... arguments):voidSets or change arguments of proxy method.
Parameters... arguments |