3 Replies Latest reply on May 26, 2008 7:59 AM by charner

    Smooth Movie Clip Movements on Rollover?

    charner
      I've been trying to figure out how to simply make movie clips nudge/move slightly to the right or left (doesn't even need to be a random movement, but that would be great too) and then return to the original place. I would like to have easing in that, not a sharp movement. Right now, I am using a tween code (import mx.transitions.Tween; import mx.transitions.easing.*;) but it won't allow me to start from one point, bounce/elastic (whatever) to another point and then ease right back. It only bounces TO another place. Any ideas?

      Thanks,
      Christy
        • 1. Smooth Movie Clip Movements on Rollover?
          charner Level 1
          Also, I'm not amazing with Actionscript, so please try to give an example. Thanks!

          Christy
          • 2. Smooth Movie Clip Movements on Rollover?
            clbeech Level 3
            you must have been doing some reading to use the methods you have mentioned - so look into the onMotionFinished handler and the yoyo methods - you could use these to play the tween in reverse once the first tween is finished, as in:
            • 3. Re: Smooth Movie Clip Movements on Rollover?
              charner Level 1
              Thanks. I'd tried a bit of onMotionComplete before, but nothing worked. I played around with it more since you suggested it and finally figured it out. I guess you just have to play around with the code for a bit to get something that looks realistic! My final code (in case anyone in the world actually cares!) was:

              myBall1_mc.onRollOver = function() {
              var myHoriTween1:Tween = new Tween(myBall1_mc, "_x", Regular.easeInOut, 100, 120,.5, true);
              myHoriTween1.onMotionFinished = function (){
              var myHoriTween1a:Tween = new Tween(myBall1_mc, "_x", Elastic.easeOut, 120, 100, 2, true);
              }
              };

              Thanks again
              Christy