| Package | vegas.events |
| Class | public class EventListenerBatch |
| Inheritance | EventListenerBatch TypedCollection |
| Implements | EventListener |
EventListener as one EventListener.
Example :
import flash.events.Event ;
import vegas.events.Delegate ;
import vegas.events.EventDispatcher ;
import vegas.events.EventListener ;
import vegas.events.EventListenerBatch ;
var EVENT_TYPE:String = "onTest" ;
var action1:Function = function (e:Event):Void
{
trace ( "action1 : " + e.type ) ;
}
var action2:Function = function (e:Event):Void
{
trace ( "action2 : " + e.type ) ;
}
var oListener1:EventListener = new Delegate(this, action1) ;
var oListener2:EventListener = new Delegate(this, action2) ;
var batch:EventListenerBatch = new EventListenerBatch() ;
batch.insert(oListener1) ;
batch.insert(oListener2) ;
var e:Event = new BasicEvent( EVENT_TYPE , this ) ;
EventDispatcher.getInstance().registerEventListener(EVENT_TYPE, batch) ;
EventDispatcher.getInstance().dispatchEvent( e ) ;
| Method | Defined by | ||
|---|---|---|---|
|
Creates a new EventListenerBatch instance.
| EventListenerBatch | ||
![]() |
add(o:*):Boolean
Inserts an element in the collection.
| TypedCollection | |
![]() |
clear():void
Removes all elements in the collection.
| TypedCollection | |
|
clone():*
Returns a shallow copy of this instance.
| EventListenerBatch | ||
![]() |
contains(o:*):Boolean
Returns
true if this collection contains the specified element. | TypedCollection | |
![]() |
get(key:*):*
Returns the element from this collection at the passed key index.
| TypedCollection | |
|
handleEvent(e:Event):void
Handles the event.
| EventListenerBatch | ||
![]() |
indexOf(o:*, fromIndex:uint = 0):int
Returns the index of an element in the collection.
| TypedCollection | |
![]() |
isEmpty():Boolean
Returns
true if this collection contains no elements. | TypedCollection | |
![]() |
Returns an iterator over the elements in this collection.
| TypedCollection | |
![]() |
remove(o:*):*
Removes a single instance of the specified element from this collection, if it is present (optional operation).
| TypedCollection | |
![]() |
size():uint
Returns the number of elements in this collection.
| TypedCollection | |
![]() |
supports(value:*):Boolean
Returns
true if the specific value is valid. | TypedCollection | |
![]() |
toArray():Array
Returns an array containing all of the elements in this collection.
| TypedCollection | |
![]() |
toSource(indent:int = 0):String
Returns the source code string representation of the object.
| TypedCollection | |
![]() |
toString():String
Returns the String representation of the object.
| TypedCollection | |
![]() |
validate(value:*):void
Evaluates the specified value and throw a
TypeError object if the value is not valid. | TypedCollection | |
| EventListenerBatch | () | constructor |
public function EventListenerBatch()Creates a new EventListenerBatch instance.
| clone | () | method |
public override function clone():*Returns a shallow copy of this instance.
Returns* — a shallow copy of this instance.
|
| handleEvent | () | method |
public function handleEvent(e:Event):voidHandles the event.
Parameterse:Event |