| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
The Delegate encapsulate a method call as an object.
The Delegate class provides two ways to encapsulate a method call :
- By creating a new Delegate instance you can wrap the call into
a command object.
- By calling the
Delegate.create method you can get
an anonymous function which will encapsulate the call.
protected var _a:Array
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Array of arguments to pass to the function
protected var _bHasEventCallback:Boolean
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Indicates whether the event object passed to the execute
method is appended to the function arguments or not.
protected var _f:Function
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
The method closure wrapped by this delegate
public function Delegate(f:Function, ... rest)
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Creates a new Delegate instance which encapsulate the call
to the passed-in function with the passed-in rest
as arguments to the function.
Parameters
| f:Function — specified method to encapsulate
|
| |
| ... rest — additionall arguments to pass to pass
to the method
|
public function addArguments(... rest):void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Appends arguments to the current function's arguments.
Parameters
| ... rest — arguments to append to the function's
arguments
|
public function addArgumentsArray(a:Array):void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Appends arguments to the current function's arguments.
Parameters
| a:Array — array of arguments to append to the function's
arguments
|
public function bypassEventCallback(b:Boolean):void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
If true the event passed to the execute
function will not be appended to the function arguments.
Parameters
| b:Boolean — true to bypass the event to be
appended to the function arguments
|
public function callFunction():*
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Calls the function with the current array of arguments.
Returns
public static function create(method:Function, ... args):Function
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Creates a anonymous function which will wrap the call
to the passed-in function with the passed-in rest
as arguments to the function.
Parameters
| method:Function — specified method to encapsulate
|
| |
| ... args — additionall arguments to pass to pass
to the method
|
Returns
| Function — an anonymous function which will wrap the call
to the passed-in function
|
public function execute(event:Event = null):void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Realizes the function call with the arguments defined
in this Delegate object.
The receive event will be append to the arguments array
except if the bypassEvenCallback have been
called with true as argument.
Parameters
| event:Event (default = null) — event object to append to the arguments
array
|
public function getArguments():Array
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Returns the current array of arguments which will be
passed to the function when called.
Returns
| Array — array of arguments which will be
passed to the function
|
public function handleEvent(e:Event):void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Allow the delegate object to be added as listener
for any event type on any object which provide the
addEventListener.
Parameters
| e:Event — event object dispatched with the event
|
public function onTick(e:Event = null):void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Method called by the TickBeacon for each
step of time according to its time slicing approach.
The onTick method is very similar to the
old onEnterFrame method, but doesn't specifically
occurs when entering in a new frame of a frame-based animation.
The tick could be the result of a setInterval call,
or a change in the timecode of a video.
Parameters
| e:Event (default = null) — event dispatched by the beacon object
|
public function setArguments(... rest):void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Defines the arguments to pass to the function
Parameters
| ... rest — arguments to pass to the function
|
public function setArgumentsArray(a:Array):void
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Defines the arguments to pass to the function
Parameters
| a:Array — array of arguments to pass to the function
|
public function toString():String
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Returns the string representation of this instance.
Returns
| String — the string representation of this instance
|
LowRA API documentation 2008- 2009
Licensed under the MOZILLA PUBLIC LICENSE, Version 1.1
mer. févr. 25 2009, 9:22 AM GMT+01:00