Packagesystem.events
Classpublic class Delegate
InheritanceDelegate Inheritance Object
Implements Cloneable, EventListener, Runnable

Delegate event listener, this listener create a proxy over a method and this scope.

Note :

  • The Delegate class implements EventListener interface. you can use a Delegate instances in the addEventListener method for all IEventDispatcher implementations.
  • The Delegate class implements system.process.Runnable interface


  • Public Properties
     PropertyDefined By
      arguments : Array
    Determinates the Array representation of all arguments called in the proxy method.
    Delegate
      method : Function
    [read-only] Indicates the proxy method reference.
    Delegate
      scope : *
    [read-only] Indicates the scope reference of the proxy target.
    Delegate
    Public Methods
     MethodDefined By
      
    Delegate(scope:*, method:Function, ... args)
    Creates a new Delegate instance.
    Delegate
      
    addArguments(... args):void
    Adds arguments in the list of all arguments passed-in the 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
      
    handleEvent(e:Event):void
    Handles the event.
    Delegate
      
    run(... arguments):void
    Run the proxy method in the provided context.
    Delegate
    Property Detail
    argumentsproperty
    arguments:Array

    Determinates the Array representation of all arguments called in the proxy method.


    Implementation
        public function get arguments():Array
        public function set arguments(value:Array):void
    methodproperty 
    method:Function  [read-only]

    Indicates the proxy method reference.


    Implementation
        public function get method():Function
    scopeproperty 
    scope:*  [read-only]

    Indicates the scope reference of the proxy target.


    Implementation
        public function get scope():*
    Constructor Detail
    Delegate()Constructor
    public function Delegate(scope:*, method:Function, ... args)

    Creates a new Delegate instance.

    Parameters
    scope:* — the scope to be used by calling this method.
     
    method:Function — the method to be executed.
     
    ... args — the optional argument to pass in the method.
    Method Detail
    addArguments()method
    public function addArguments(... args):void

    Adds arguments in the list of all arguments passed-in the proxy method.

    Parameters

    ... args

    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):Function

    Creates a method that delegates its arguments to a specified scope. This static method is a wrapper for MM compatibility.

    Parameters

    scope:* — this scope to be used by calling this method.
     
    method:Function — the method to be called.
     
    ... arguments

    Returns
    Function — a Function that delegates its call to a custom scope, method and arguments.
    handleEvent()method 
    public function handleEvent(e:Event):void

    Handles the event.

    Parameters

    e:Event

    run()method 
    public function run(... arguments):void

    Run the proxy method in the provided context.

    Parameters

    ... arguments