4 Replies Latest reply on Jul 5, 2007 11:25 AM by ntsiii

    Non-blocking modal dialog

    shikan_taza
      Hi everybody,

      I would like to display a modal dialog box, capture the user input and use it for further processing, as below:

      showWindow(); //calls PopupManager.createPopUp()
      // code to process user input

      My problem is that the showWindow() call is non-blocking, i.e. the code to process the user input gets executed immediately after the modal window is displayed. How do I make it execute after the modal window is closed?

      Any help will be greatly appreciated.

      Thanks,

      Rajesh Jayaprakash
        • 1. Re: Non-blocking modal dialog
          dimival Level 1
          You can register a Listener for the Close event of the popUp window, and then on that listener invoke the method that you want to execute when the window is closed.
          • 2. Re: Non-blocking modal dialog
            shikan_taza Level 1
            Thanks, dimival.
            • 3. Re: Non-blocking modal dialog
              Gregor Rot
              quote:

              Originally posted by: dimival
              You can register a Listener for the Close event of the popUp window, and then on that listener invoke the method that you want to execute when the window is closed.


              OK this is actually very bad programming, because i want to be able to do stuff like:

              Function1:
              - showModal();
              - decide what to do based on the results
              - showModal() again, do some other things
              etc.

              and what i have to program is:

              Function1:
              showModal(); on close go to some function

              Function2:
              do some things in accordance to the results...

              This is very unconvenient. I have to pass and share all needed variables from Function1 to Function2, redo some things...

              Is this actually the main disadvantage of a scripting language like actionscript?
              • 4. Re: Non-blocking modal dialog
                ntsiii Level 3
                There is no code blocking in the Flash Player. You must use events. Many new AS developers fuss about it, but there it is. We don't get to write the language.

                Tracy