5 Replies Latest reply: Aug 26, 2012 2:10 PM by TimsterVideo RSS

    How to count to 8 and then start over

    TimsterVideo Community Member

      My problem is that I can't seem to reset the countReg var back to 0 once it hits 8. any ideas?

       

       

      var countReg:Number = 0;

       

       

      function nextReg(event:MouseEvent) : void

      {

                   if (countReg == 9)

                {

                          (countReg == 0);

                 }

                countReg++;

       

                trace (countReg)  // it just keeps counting up. won't start over after 8

       

      }

       

       

      this.next1_btn.addEventListener (MouseEvent.CLICK, nextReg);

       

       

      THANKS MUCH