3 Replies Latest reply on Jul 25, 2007 10:34 PM by Tony_CI

    onrollOut, play MC backwards to start

    mattlajoie
      Hey guys, i have been trying to search about this but am having no luck, if anyone has any info about this, it would be GREATLY appreciated.

      I have a button.
      i have a MC, that say for example, is a MC of a ball moving from left to right.

      im am trying to understand, or figure out the code that make it so that when you roll OVER the button, the MC starts playing (ball starts going from left to right), then once you roll OFF the button, the MC automatically starts playing backwards (ball starts going right to left, back to where it started)


      i guess what i would like to know is how to make a MC play backwards to its starting frame on rollOUT

      anyone?? thanks guys :)

      -m@
        • 1. Re: onrollOut, play MC backwards to start
          Tony_CI Level 1
          Hi Matt,
          OK this is how i have done it, I'm sure there are better ways out there which others will no doubt point out, but this is a start. 3 parts to this...

          1. Create your movie clip of the animation from left to right or right to left with no stops or anything in it. Give it an instance name of myRollover

          2. On the frame script, put in...
          _root.myRollover.onEnterFrame = function() {
          if (mouse_over_myRollover) {
          _root.myRollover.nextFrame();
          } else {
          _root.myRollover.prevFrame();
          }
          };

          3. Then, create an invisible button over that rollover and add the following code to that...
          on (rollOver) {
          _root.mouse_over_myRollover = true;
          } on (rollOut) {
          _root.mouse_over_myRollover = fstartlse;
          }
          on (release){
          Whatever you want to do
          }

          Hope that helps
          Cheers,
          Tony
          • 2. Re: onrollOut, play MC backwards to start
            mattlajoie Level 1
            Thank you Tony ;), dont know how long i have been trying to figure that out.
            • 3. Re: onrollOut, play MC backwards to start
              Tony_CI Level 1
              Not a problem, glad that I was able to explain something coherently... and offer advice rather than take advice!

              Now you can go forth and add roll over and outs to everything possible!!!!