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 [email protected], 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.
>


Reply via email to