Class org.as2lib.env.event.SimpleEventListenerSource

Implemented Interfaces

EventListenerSource

Description

SimpleEventListenerSource manages listeners in the simplest way possible.

Method Index

new SimpleEventListenerSource()
addAllListeners(), addListener(), getAllListeners(), hasListener(), removeAllListeners(), removeListener()

Inherited from BasicClass

Constructor Detail

SimpleEventListenerSource

public function SimpleEventListenerSource(listeners:Array)

Constructs a new SimpleEventListenerSource instance.

Parameters

listeners(optional) a collection of listeners to populate this listener source with

Method Detail

addListener

public function addListener(listener):Void

Adds the passed-in listener.

The listener will only be added if it is neither null nor undefined and if it has not already been added to this listener source.

Parameters

listenerthe listener to add

Specified By

addListener() in org.as2lib.env.event.EventListenerSource

addAllListeners

public function addAllListeners(listeners:Array):Void

Adds all listeners contained in the passed-in listeners array.

If the passed-in listeners array is null or undefined it will be ignored. If an individual listener is null or undefined it will be ignored too.

Note that the order of the listeners contained in the passed-in listeners array is preserved.

Parameters

listenersthe listeners to add

Specified By

addAllListeners() in org.as2lib.env.event.EventListenerSource

See Also

removeListener

public function removeListener(listener):Void

Removes the passed-in listener.

The removal will be ignored if the passed-in listener is null or undefined.

Parameters

listenerthe listener to remove

Specified By

removeListener() in org.as2lib.env.event.EventListenerSource

removeAllListeners

public function removeAllListeners(Void):Void

Removes all added listeners.

Specified By

removeAllListeners() in org.as2lib.env.event.EventListenerSource

getAllListeners

public function getAllListeners(Void):Array

Returns all added listeners.

Return

all added listeners

Specified By

getAllListeners() in org.as2lib.env.event.EventListenerSource

hasListener

public function hasListener(listener):Boolean

Returns true if passed-in listener has been added.

Parameters

listenerthe listener to check whether it has been added

Return

true if the listener has been added

Specified By

hasListener() in org.as2lib.env.event.EventListenerSource