3 Replies Latest reply on Oct 1, 2013 10:08 AM by AMULI

    Jumping to a point after specific time

    amber_abb

      I have created buttons to run different animations. At the end of each of these animations, I want to stop for 3-4 seconds and then jump back to a common starting point in the timeline.

       

      How do introduce the wait time of 4 seconds in the following code?

       

       

      sym.stop();

      // play the timeline from the given position (ms or label)

      sym.play("startPoint");

        • 1. Re: Jumping to a point after specific time
          AMULI Level 4

          Hi amber_abb,

           

          Don't run a sym.stop(); at the end of your animation. Let the playhead run 3-4 more seconds  in the timeline (even if nothing happens on stage). Say you reach point 0:15. You could insert a trigger (déclencheur in french) there (shorcut Ctrl-T) and inside it initiate the jump back :

           

          Capture d’écran 2013-10-01 à 11.57.27.png

           

          Gil

          • 2. Re: Jumping to a point after specific time
            amber_abb Level 1

            Thanks. I can do this too. But there are other instances in my timeline where i want some symbol or part of animations to run in loop for different time. It would help to know how you insert time constraint.

             

            E.g

            Consider three trigger points in my time line. "Start", "mid", "end"

             

            When i reach "mid", i want jump back to "start"

             

            Sys.play("start")

             

            But after this loop is repeated for lets say 3 minutes, now when the play head reaches "mid", it keeps running till the "end".

             

            Now i want it to stop at "end" for few seconds and then jump to "anotherTrigger" again.

             

            This happens at different point on my project and i really want to know how to add time constraints

            • 3. Re: Jumping to a point after specific time
              AMULI Level 4

              Ok amber_abb,

               

              We use an upDown symbol containing a basic animation. A first instance upDown-1 has a playback action play() (black triangle on white background) at label start. The second instance upDown-2 has a playback action play() a bit after label mid and a third  instance upDown-3 has a playback action play() later.

               

              Capture d’écran 2013-10-01 à 19.00.15.png

               

              We wrap all the needed variables in a TIMING object defined in the compositionReady event handler :

               

              TIMING =

              {

                loopCounter: 0,

                maxLoops: 5,

                delay: 2000 // in ms

              };

               

              Trigger at label mid :

               

              if (TIMING.loopCounter++ < TIMING.maxLoops)

              {

                sym.$('loopCount').text( TIMING.loopCounter);

                sym.play('start');

              }

              else

              {

                sym.stop();

                setTimeout( function()

                {

                  sym.play('mid');

                }, TIMING.delay);

              }

               

              Trigger at label end :

               

              sym.stop();

               

              The JavaScript method setTimeout() delays the execution of the function passed as its first parameter (here an anonymous function). Its second parameter is the delay given in ms.

               

              http://w3schools.com/js/js_timing.asp

               

              Downloadable example here : https://app.box.com/s/7m6dz8zzmrjirv8a34fx

               

              Gil

              1 person found this helpful