1 Reply Latest reply on Nov 8, 2012 11:37 AM by kglad

    Loop Button

    Kat1585

      Hi There,

       

      I am a novice when it comes to flash and need help adding a loop to a button.

       

      I have a simple 5 frame flash player with previous and next buttons to navigate. I would like to add a loop to the button so that when I get to frame 5 it goes back to frame 1, and the reverse for the previous button.

       

      This is the code I have on my button right now

       

      on (release) {

          nextFrame();

      }

       

      I am running CS4.

       

      Any help would be appreciated, thanks.

       

      - Katie

        • 1. Re: Loop Button
          kglad Adobe Community Professional & MVP

          next btn:

           

          on(release){

          if(_currentframe==5){

          gotoAndStop(1);

          } else {

          nextFrame();

          }

          }

           

          prev btn:

           

          on(release){

          if(_currentframe==1){

          gotoAndStop(5);

          } else {

          prevFrame();

          }

          }

           

          p.s. please mark helpful/correct responses.