4 Replies Latest reply on Oct 6, 2010 5:57 PM by BennyB23

    Suspending event execution


      How do I suspend the execution of a change event for a ViewStack component, prompted by a mouse "click" event on a tabBar, which is the dataProvider for the ViewStack and determine whether or not, or in what way the event is processed, based on the selected property of an alert prompt. In its simplest form; either canceling the event or allowing the default to be passed as it would've without the prompt.



        • 1. Re: Suspending event execution
          Flex harUI Adobe Employee

          I didn't understand the details of the question.  The event flow cannot be

          suspended such that it can be continued from the point it was suspended.

          You can end the flow by calling stopImmediatePropagation().  There is no way

          to restart it other than re-dispatching the event which might re-visit

          listeners that previously saw the event.

          1 person found this helpful
          • 2. Re: Suspending event execution
            BennyB23 Level 1

            Thanks, that makes sense. Essentially it's at least two events; one to prevent the default, then a separate one to either dispatch a new change event, or close the prompt. At least that's how I interpreted your reply.


            So my next question, which hopefully will be more clear (certainly no guarantees though;), is this: if I want the use conditional logic to determine how the event is handled each time it's dispatched, what would be a recommended approach?


            The context is that the ViewStack will be toggling between an audio menu and a video menu and if the user attempts to switch menus while a song or video is playing, I want to inform them that toggling the menu will stop whatever's currently playing and let them choose to continue, or wait until the current item is finished.



            • 3. Re: Suspending event execution
              Flex harUI Adobe Employee

              I think most folks are doing that by setting selectedIndex back to where it


              1 person found this helpful
              • 4. Re: Suspending event execution
                BennyB23 Level 1

                Thanks, I'll try something along those lines.