2 Replies Latest reply on Aug 10, 2010 12:29 AM by smagfx2

    Listen for popup added event?

    smagfx2

      Hi,

       

      I've got an application where I am loading large amounts of data synchronously. Before I do this, I would like to show a popup to the user telling them that

      the application has started processing their request and will be done shortly.

       

      The problem is that PopUpManager.addPopUp doesn't create/show the popup immediately. If I use the following code (pseudo-code) then the application freezes for a few seconds and after the synchronous load shows the popup.

       

      PopUpManager.addPopUp(popUp, this, true);
      doSomeIntensiveLoadOperationThatTakesAWhile();
      

       

      So, I know that I need to listen for some event from Flex before my synchronous operation like this (pseudo-code):

       

      popUp.addEventListener(SomeEvent.TYPE, doSomeIntensiveLoadOperationThatTakesAWhile);
      

       

      But I don't know what event to listen for and from what. I've tried listening for FlexEvent.CREATION_COMPLETE,  Event.ADDED_TO_STAGE,  FlexEvent.INITIALIZE, and FlexEvent.SHOW from the popup. 'creationComplete' got me the closest (but the popup still wasn't visible) and 'show' didn't fire at all. I can sort of fake it with setTimeout(250), but there's got to be some way to know exactly when the popup is added.