Class adways.hv.Bridged
Extends: adways.event.EventDispatcherBridged class description
adways.hv.Bridged
(
)
private
<Number>
addEventListener
( kind, callback, [instance=null], [priority=0], [useWeakReference=false]
)
public
Adds an event listener of a specific event kind.
Parameters:
-
kind
<Constant>kind of the event to listen -
callback
<FUNCTION>function called when the event is fired -
[instance=null]
<Object> optionalcallback's instance. Useful when the callback is binded to an object:Class = function () {}; Class.prototype.callback = function () {}; var a = new Class(); aDispatcher.addEventListener(AN_EVENT_KIND, a.callback, a);
-
[priority=0]
<Number> optionalpriority -
[useWeakReference=false]
<Boolean> optionalnot yet used
Return:
<Number>:
1 if event added, 0 otherwise (already added callback).
When
instance==null
, the callback should be accessible from the global context and be a "static" method. Exemple:namespaceA.subnamespace.myCallback = function (event) { ... }; aDispatcher.addEventListener(AN_EVENT_KIND, namespaceA.subnamespace.myCallback);
connect
(
)
public
Connect bridged element
<Number>
hasEventListener
( kind, callback, [instance=null]
)
public
Whether or not a listener has already been added.
Parameters:
-
kind
<Constant>the event's kind -
callback
<FUNCTION>the listener's function -
[instance=null]
<Object> optionalthe listener callback's instance
Return:
<Number>:
the listeners count.
isConnected
(
)
public
Connect bridged element
<Number>
nbEventListeners
( kind
)
public
Counts the listeners added for a specific event.
Parameters:
-
kind
<Constant>the event's kind
Return:
<Number>:
the listeners count.
<Number>
removeAllEventListeners
(
)
public
Removes all the listeners.
Return:
<Number>:
1 on success (currently always), 0 otherwise.
<Number>
removeEventListener
( kind, callback, [instance=null]
)
public
Removes an event listener of a specific event kind.
Parameters:
-
kind
<Constant>kind of the event to listen -
callback
<FUNCTION>function called when the event is fired -
[instance=null]
<Object> optionalcallback's instance
Return:
<Number>:
1 if event removed, 0 otherwise ( couple < instance + callback > not found).