i see that you create a singlton to dispatch and addeventlistener. that makes
sense.

but what is this class EventListener?

thanks!!

c



nathanleewei-2 wrote:
> 
> public class MessageEventBus extends EventListener {
>     public static getInstance(): MessageEventBus {
> ....
>     }
> }
> //
> public class ParentApplication {
>     var messageEventBus:MessageEventBus = MessageEventBus.getInstance();
>     public ParentApplication {
>        
>     }
> 
>     public function onHttpServiceResult(event:ResultEvent):void {
>         //...
>         //...
>         messageEventBus.dispatchEvent(new
> Event("ParentApplicationFinish"));
>     }
> }
> 
> 
> //
> public class AModule {
>     var messageEventBus:MessageEventBus = MessageEventBus.getInstance();
>     public ParentApplication {
>        messageEventBus.addEventListener("ParentApplicationFinish",
> onParentApplicationFinish);
>     }
>     public function onParentApplicationFinish(event.Event):void {
>         //do what you want.
>     }
> }
> 
> 
> 
> --- In flexcoders@yahoogroups.com, coder3 <rrhu...@...> wrote:
>>
>> 
>> Hi
>> 
>> I have a module, that needs to wait for the parentApplication to finish
>> the
>> httpservice so that it can get the data and do some stuff.
>> 
>> so the httpservice has a result handling function, 
>> 
>> how can the module know when to get the result? i guess i need to use
>> eventlistener, how?
>> 
>> thanks!
>> c
>> 
>> 
>> -- 
>> View this message in context:
>> http://www.nabble.com/how-to-wait-for-one-event-to-finish--tp25067200p25067200.html
>> Sent from the FlexCoders mailing list archive at Nabble.com.
>>
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/how-to-wait-for-one-event-to-finish--tp25067200p25181436.html
Sent from the FlexCoders mailing list archive at Nabble.com.

Reply via email to