7 Replies Latest reply on Oct 18, 2011 3:25 PM by Ned Murphy

    adding a loop to the following codes

    dharmes Level 1

      i will like to add a loop to this codes below

       

      var myTimer: Timer = new Timer(1000);

      myTimer.start();

       

      myTimer.addEventListener(TimerEvent.TIMER, nextPic)

       

      function nextPic(e:TimerEvent):void {

       

      if (currentFrame ==5)

       

      {

       

      gotoAndPlay(1);

       

      }

      else

      {

      nextFrame();

      }

       

      }