Log in

View Full Version : Move An MC Away From Mouse Movements...



tomyknoker
05-16-2007, 02:36 AM
Hi,

Just wondering if anyone knows how to make a mc move away from the mouse, once a movie is playing? Basically if the mouse moves to the bottom left hand corner of the screen I want the movie clip which will be sitting on the stage to move to the top right corner... The only thing is I only want the mc to move about 5 pixels, I don't want to fling it to the very edge of the stage... Any ideas anyone?

Medyman
05-23-2007, 03:01 PM
Do you want this to be a dynamic process? What I mean by that is do you want the MC to gradually move to the upper left as your mouse moves to the lower right

OR

Do you want the MC to move to the upper left only when you are in the lower right?

I don't suggest going with the first option because moving 5 pixels over the span of a mouse drag across a screen won't really do much.

For the second situation:
Make an invisible button in the bottom right and use MCTween (or Tween Class) to move the MC. Something like this:


invisible_button.onRollOver = function() {
MC.xSlideTo(MC._x - 5, 1, "easeOutQuad")
MC.ySlideTo(MC._y - 5, 1, "easeOutQuad")
}