0 Replies Latest reply on Jul 14, 2015 5:10 AM by Corrie1000

    Back and next buttons to labels in timeline

    Corrie1000 Level 1

      Hi,

      I want to create simple back and next buttons that jump to points along the timeline. I found some code that creates this using the time position e.g. 1000 millisecs, 2000 millisecs but I need it to go to a specified label.

       

      I don't want it to loop i.e. say my labels are 1,2,3,4,5 I don't want it to go back to '1' after '5'

       

      Here is the code for timeline position, can anyone show me how to change this to go to labels instead:

       

      Thanks

       

      //for the back button:

      var pos = sym.getPosition() // this is a numeric variable that gets the current time in the animation its in miliseconds so at one second this will have a value of 1000 at two seconds 2000 and so on

       

      if (pos <= '1'){

                sym.play('5'); // this if statement is checking to see what slide the animation is on, if it is in the first slide, it will play the begining of the last slide

      }

      else if (pos <= '2'){

                sym.play('1'); // if it is in the second slide, it will play the beginning of the first slide

      }

      else if (pos <= '3'){

                sym.play('2');  // if it is in the third slide, it will play the beginning of the second slide

      }

      else if (pos <= '4'){

                sym.play('3');  // if it is in the fourth slide, it will play the beginning of the third slide

      }

      else {

                sym.play('1');

      }

       

      // for the forward button its the same concept only reversed