Hey guys,
I’m trying to reverse the direction of my mouse follower which I tween using TweenLite…
I have an image bigger than the stage, when it first loads, I define a starting point, then on enter frame I keep defining points according to the mouse position, and then I tween to the difference…
The question is how can I reverse this action, so that when I move the mouse to the right, the image goes to the left instead of following the mouse to the right???
Here is the code I use…
var finalDX;
var finalDY;
var mouseLocFirstTime:Point = new Point(mc2._xmouse, mc2._ymouse);
mc2.onEnterFrame = function()
{
mc2.onMouseMove = function()
{
var destination:Point = new Point(mc2._xmouse,mc2._ymouse);
finalDX = destination.x - mouseLocFirstTime.x;
finalDY = destination.y - mouseLocFirstTime.y;
TweenLite.to(mc2,2,{_x:mc2._x + finalDX, _y:mc2._y + finalDY});
};
}
mc2 is the name of my image movie clip…the image inside the movie is aligned top left…
Any help would be greatly appreciated guys!!!