Support Staff2 Posted by Ondina D.F. on 02 Feb, 2012 11:12 AM
Is there a way in RL that we can show a loading popup by
instantiating all the events at startup in one class e.g
GetUserEvent(), GetSettingsEvent() etc.. and removed once they are
Are you asking how to remove events’ listeners?
You can “unmap” the listeners in the handler method
of the mapped event, for example in a Mediator:
override public function onRegister():void
eventMap.mapListener(eventDispatcher, SomeModelEvent.DATA_UPDATED, onDataUpdated, SomeModelEvent);
protected function onDataUpdated(event:SomeModelEvent):void
eventMap.unmapListener(eventDispatcher, SomeModelEvent.DATA_UPDATED, onDataUpdated, SomeModelEvent);
Are you asking how to unmap a Command triggered by an
If you mapped a command like this:
you can “unmap” it like this:
or if you map the command with oneshot (last
parameter) set to true, the unmapping occurs
automatically after execution:
SomeServiceResultCommand, SomeServiceResultEvent, true);
Support Staff3 Posted by Ondina D.F. on 04 Feb, 2012 10:27 AM
I answered your question while having a fever, and obviously I
missed the point.
You were talking about instantiating events, and that was
confusing, because you don't instantiate events. You
dispatch an event, that either triggers a Command, or a
handler in a class that has registered a listener for it.
So, probably, your question was:
1. How to remove event listeners after closing a pop up?
2.How to remove a pop up after the loading of data has
1.In case the Mediator of the pop up has registered events'
listeners in its onRegister(), they will be removed automatically
when the mediator is unregistered(removed) from the framework.
So, when you close the pop up, the view dispatches an event. The
mediator listens to it:
protected function onClosePopup(event:PopUpEvent):void
2.When you open the pop up its Mediator registers a listener for
an event, say ResourceEvent.LOADING_COMPLETE, in its onRegister()