4 Replies Latest reply on Feb 5, 2013 12:00 PM by TimJaramillo

    Stop timeline via JS?

    shazdeh187

      Hello from Hamburg,

       

      I´m using Edge for couple of days and start to work with and I love it.

      Now I´m trying to build a slide animation, so the content moves from right to left and vice versa.

      The controller goes with buttons.

       

      Im not very good with JS, but for now I got it to move the content from left to right. Now what I want is, to stop the timeline if a certain label is reached.


      This is my code for the buttons if click:

       

      var myLabelLocation = sym.getLabelPosition("");

       

      if (sym.getPosition() < 2000) {

         sym.play(myLabelLocation);

      }

      if (sym.getPosition() > 2000) {

         sym.playReverse(myLabelLocation);

      }

       

      I like to say if the playhead reached 2000ms oder the label "team", than stop!

       

      Sorry for my bad english, I hope I could say that clear :-))

       

      For every suggestion I am very grateful!

        • 1. Re: Stop timeline via JS?
          dhosford Employee Moderator

          Hi there,

           

            You could put a trigger into the Edge Animate file and tell the player to stop that way without having to code it in. : )

           

            Just move your playhead to the point on the timeline in which you'd like to stop and click CMD + T on a Mac or CTRL + T on a PC. A window will pop up where you can put in the Trigger. On the right hand side there are code snippets that you can click that will insert the code for you without having to write it. Click the "Stop" code snippet button:

           

          stop.png

           

          That's it! Just close out of the trigger window and your animation will now stop at the timecode using this trigger. : )

           

          I hope this helps! Let me know if you need further clarification!

          • 2. Re: Stop timeline via JS?
            shazdeh187 Level 1

            Thanks a lot... I know what you mean, but this dosen´t work for me.

            Because every time the playhead reach a trigger with the comand stop, than the animation will stop!

            So if I´m at the start of the animation and want to get the last frame/content, than I click a button and and the animation shoult start sliding all 4 contents untill the playhead reach the last frame --> than Stop!

            So and than, if I want to see the content on my second trigger, than the animation should play revers until the right frame --> than stop...

            So on and so on :-))

            • 3. Re: Stop timeline via JS?
              shazdeh187 Level 1

              Nobody has any idea how I can stop the timeline via code while the animation is running??

              • 4. Re: Stop timeline via JS?
                TimJaramillo Level 4

                Hi there, can you clarify what you mean by "oder" in this line:

                 

                I like to say if the playhead reached 2000ms oder the label "team", than stop!