5 Replies Latest reply on May 18, 2015 5:34 AM by Allison@HavasLynx

    Play either full timeline or just between two labels

    Allison@HavasLynx Level 1

      Hi,

      I am using EA 2014.1.1

      I have a comp which has 5 steps. There are labels on the timeline marking where each step begins (called frame1, frame 2... etc).

      The play button sets the timeline running and all steps are played through in turn.

      I also have 5 buttons, one for each step. I would like to add a function which just plays the frames for an individual step.

      If I put stop() actions on the timelines to stop at each step, then I won't be able to use the play button to play the 5 steps in sequence.

      I have tried to target the position of the timeline with the 5 buttons:

       

      eg. for button 1

      sym.getComposition().getStage().getSymbol("cascade-anim").play("step1");

      But this plays from step1 and continues the timeline and plays the subsequent frames as well, when I want it to stop at step2 if button 1 is clicked.

       

      I tried an if/else statement as well, something like:

      //Wherever the playhead is at the moment - go to step1 and stop

      sym.getComposition().getStage().getSymbol("cascade-anim").stop("step1");

       

      if (sym.getComposition().getStage().getSymbol("cascade-anim").getPosition("step1")) {

      //When we are at step1, start playing

        sym.getComposition().getStage().getSymbol("cascade-anim").play();

      //When we get to step2

      }else if (sym.getComposition().getStage().getSymbol("cascade-anim").getPosition("step2")) {

      //Stop playing

        sym.getComposition().getStage().getSymbol("cascade-anim").stop();

      }

       

      But when I use this it just stops at step1

       

      Can anyone give me some advice please?

      Thanks

      Allison