4 Replies Latest reply on Mar 12, 2010 10:55 AM by kglad

    Actionscript 1 to 2 button reverse

    Man213Ba213rt123

      Hey guys, i found some nice code on AS1 to use with my Button and MC.

       

      Basically

      the MC doesnt play when mouse is not on button

      when mouse over button i want the MC to play. (only once then stop)

      when mouse off button i want the MC to play in reverse. (and stop when its back to the beginning)

       

      (btw both the MC and Button are in a movie clip - as i need to make many of them)

       

      the code is in AS1 and doesnt seem to work in AS2 which is where i need it.

      Maybe someone can see whats wrong and convert parts for me or give me a new code


      code for button:


      on (rollOver) {
      mc1.goBack = false;
      mc1.play();
      }
      on (rollOut) {
      mc1.goBack = true;
      }


      code for MC:


      onClipEvent (enterFrame) {
          this.rewind();
      }

       

      code for actions layer:


      MovieClip.prototype.rewind = function () {
      if (goBack && (_currentframe>1)) {
      gotoAndStop (_currentframe-1);
      }
      }

       

       

      thanks i really need this code!!!! appriecate any1s help =)