Hi folks,
Firsty I would like to say thank you for providing the stuff. I'am using
Flex for a several years and every time I encouter EventDispatcher object I
fill sad due to this.
As for me I would extend the inteface of this entity.At present we have
addEventListener(eventType, Listener) removeEventListener(eventType,
Listener)
Every parameter is mandatory. But why don't we have those?
removeAllEventListeners()removeEventListener(eventType, Listener = null)
The last one removes all the listeners of the given type. May be you will
consider the extension of EventDispatcher by adding those methods to
IEventDispatcher? (even stay compatible with the existing code)
Current interface excludes the right usage (I mean clean up listeners) of
the case where actual listeners decorated by some proxy listener function
e.g.
private function proxy(listener: Function): Function{ function
onEvent(event: Event): void { if (_ignoredEvents.indexOf(event.type) ==
-1) { _events.push(event); } if (listener != null) {
listener(event); } } return
onEvent;}...eventProducer.addEventListener(Event.EVENT_NAME,
proxy(listener));
What would you say?
--
View this message in context:
http://apache-flex-users.2333346.n4.nabble.com/EventDispatcher-interface-tp10406.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.