4 Replies Latest reply on Mar 24, 2009 8:12 PM by Newsgroup_User

    Control event sequence in transition

    glen08 Level 1
      I have two transitions on a same image object. The two transitions are started by two click events, respectively. The two click events are independent from each other. Each transition takes about 5 sec. to complete.

      When one transition is started and before it is completed, the second transition can be started. I found the image
      would stop performing any transition and handing in the middle of the first transition. How can I control the sequence of the events so that second transition only starts after the first transition is done even second transition is triggered before the first is completed.
        • 1. Re: Control event sequence in transition
          Gregory Lafrance Level 6
          Maybe when one transition starts, set a Boolean variable named inProgress. Then you have to figure out how to have both transitions check this variable, and if it is true, then have that transition that must wait set another String variable to the ID of the transition that is waiting. Both transitions will, before they complete, see if a transition is waiting, and if so, it will fire it off.

          My description above may be very different from what you actually code, but you get the idea.
          • 2. Re: Control event sequence in transition
            glen08 Level 1
            I was hoping that Flex has something built-in like Java's thread-thread communication.
            • 3. Re: Control event sequence in transition
              Level 7

              "glen08" <webforumsuser@macromedia.com> wrote in message
              news:gqbdsl$6b6$1@forums.macromedia.com...
              >I have two transitions on a same image object. The two transitions are
              >started
              > by two click events, respectively. The two click events are independent
              > from
              > each other. Each transition takes about 5 sec. to complete.
              >
              > When one transition is started and before it is completed, the second
              > transition can be started. I found the image
              > would stop performing any transition and handing in the middle of the
              > first
              > transition. How can I control the sequence of the events so that second
              > transition only starts after the first transition is done even second
              > transition is triggered before the first is completed.

              On click, check to see if the other effect is running. If it is not, do
              what you do now. If it is, add an event listener that will fire when the
              other effect is done, then run the second effect.

              HTH;

              Amy


              • 4. Re: Control event sequence in transition
                Level 7

                "glen08" <webforumsuser@macromedia.com> wrote in message
                news:gqbsmk$neo$1@forums.macromedia.com...
                >I was hoping that Flex has something built-in like Java's thread-thread
                >communication.

                Flex will fire an event when the effect is finished. That's built in :-)