2 Replies Latest reply on Sep 4, 2015 10:03 AM by Pixones

    Variable + Loop = "undefined"

    Pixones Level 1

      Hello,

       

      I want to make only one loop in my animation and then continue.

      To this I added a trigger on my timeline and added this code:

       

      if (typeof oneLoop == 'undefined') {
        var oneLoop = true;
      }
      
      if (oneLoop) {
        oneLoop = false;
        sym.play(0);
      }
      

       

      But the loop is infinite because the variable resets.

      How to do ?