7 Replies Latest reply on Feb 4, 2013 6:50 AM by Seruhio

    Loop isn't working?

    Seruhio

      I'm using a trigger at the end of my timeline but it just gets ignored and never loops.

       

      I tried:

       

      sym.play(0);

       

      this.play(0);

       

      sym.play("start"); (With the "start" label placed at the beginning of the timeline.

       

      Any ideas?

       

      I have done this before so I have no clue what I am doing wrong this time.

        • 1. Re: Loop isn't working?
          jbowden Adobe Employee

          Your syntax looks correct, except maybe for using "this" instead of "sym".

           

          You could try setting it to a variable, and then examine what you get in a Javascript browser console, e.g.;

           

          var test = sym.play(0);

          console.log(test);

           

          Preview in Browser, open a Javascript console, and see what gets logged (it should be "Object", if the loop is executing correctly).

           

          If that's what you get in the console, but loop is not working, it may be best to post a link to an example file where it fails.

           

          hth,

          Joe

          • 2. Re: Loop isn't working?
            Seruhio Level 1

            I just did a simple animation on a new file and the code worked perfectly.

             

            On the file im having trouble with all my elements are grouped inside separated symbols, and this is what i think is causing my issue.

             

            My timeline looks like this (idk if its helpful, i'm aware the trigger is missing in this snapshot. Lets pretend its sitting at the end of the timeline)

            Captura666.jpg

            If I erase the symbols and animate each element on the stage's timeline the code works. Am I missing something or doing something wrong?

            • 3. Re: Loop isn't working?
              resdesign Adobe Community Professional & MVP

              If you are playing your symbols and they stop at the end of their timeline, you need to send them back to the beginning of their timeline when you go back to the beginning of the main timeline that contains them.

              Also, do the symbols play the first time?

              • 4. Re: Loop isn't working?
                Seruhio Level 1

                Yes, they play perfectly the first time. Could you give me an idea how to reset every timeline?

                 

                I feel it can be achieved on the same trigger but I'm not 100% sure.

                 

                I'll try something like this

                 

                 

                sym.getSymbol("symbol1").play(0),

                sym.getSymbol("symbol2").play(0),

                sym.getSymbol("symbol3").play(0),

                sym.getSymbol("symbol4").play(0),

                sym.play(0)

                 

                I'll see what happens


                • 5. Re: Loop isn't working?
                  Seruhio Level 1

                  I just placed a trigger on each symbol with this code

                   

                  sym.play(0);

                   

                  and worked

                   

                  Idk if there is a quicker/easier/cleaner way to do it tho

                  • 6. Re: Loop isn't working?
                    resdesign Adobe Community Professional & MVP

                    Sorry I was busy this weekend. Glad it worked!

                    • 7. Re: Loop isn't working?
                      Seruhio Level 1

                      Don't apologize. I consider myself lucky for getting a response on the weekend. Thank you very much!