2 Replies Latest reply on Jan 27, 2016 5:00 AM by 1234jaime

    How could I move the timeline to 0...?

    1234jaime

      Hello  :

       

      In "bienvenida_sym" symbol I have a button called "entrante_btn", when i click on it run this code :

       

      sym.getComposition().getStage().$("entrante_sym").play();


      at the first click the animation run well, but if I go back and then click on "entrante_btn" again the

      animation starts on the last point of timeline and not in start timeline.

       

      This code don't work and I don't know why....

      sym.getComposition().getStage().$("entrante_sym").play(0);

        • 1. Re: How could I move the timeline to 0...?
          joel_pau Level 5

          Hello,

           

          sym calls the current symbol.

           

          sym.play() calls the current symbol and play from the current position.

           

          sym.play(0) calls the current symbol and play from the beginning (the zero second).

           

          sym.getComposition().getStage() calls the root of your composition.

           

          sym.getComposition().getStage().play(0) calls the main timeline and play from the beginning.

           

          sym.getComposition().getStage().$("entrante_sym").play() doesn't make sense because you don't call a symbol using the function getSymbol("symbolName");

           

          sym.getComposition().getStage().$("entrante_sym").play(0) doesn't make sense because you don't call a symbol using the function getSymbol("symbolName");

           

          Your solution?

          You can play a symbol:

          1) from the current symbol ==> sym.play(0);

          2) from another symbol ==> sym.getSymbol("entrante_sym").play(0);

          3) from nested symbols ==> sym.getSymbol("bienvenida_sym").getSymbol("entrante_sym").play(0);

          4) from the root ==> sym.getComposition().getStage().getSymbol("entrante_sym").play(0);

          • 2. Re: How could I move the timeline to 0...?
            1234jaime Level 1

            Thanks, thanks, thanks...

            you're a crack and I'm a beginner.