TweenLite help

Hi there!

I am new to AS3 and just getting to know TweenLite. I am trying to implement TweenLite into my script (below) to make the mouse follow alot smoother, can anyone point me in the right direction?

I appreciate your help in advance!



import scripts.TweenLite;

//This is the code for the invisible buttons which instigates the tooltip appearing and dissapearing
click_btn1.addEventListener(MouseEvent.MOUSE_OVER, click_btn1_over);
click_btn1.addEventListener(MouseEvent.MOUSE_OUT, click_btn1_out);
stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMove);
//contentmc.tooltip01_mc.addEventListener(Event.ENTER_FRAME, click_btn1_on);

function click_btn1_over(m:MouseEvent):void {
    tooltip01_mc.gotoAndPlay(2);
}
function click_btn1_out(m:MouseEvent):void {
    tooltip01_mc.gotoAndPlay(12);
}


function mouseMove(event:MouseEvent){
 var yMouse = tooltip01_mc.parent.mouseY;
    var max = 0;
    if(tooltip01_mc.parent.mouseY<0)
    { tooltip01_mc.y -= (tooltip01_mc.y-max) / 8;}
    else {

    if(Math.abs(yMouse - tooltip01_mc.y) < 1) {
        tooltip01_mc.y = yMouse;
    } else {
        tooltip01_mc.y -= (tooltip01_mc.y-yMouse) / 8;
    }
    
    var xMouse = tooltip01_mc.parent.mouseX;
    if(tooltip01_mc.parent.mouseX<0)
    { tooltip01_mc.x -= (tooltip01_mc.x-max) / 8;}
    else {

    if(Math.abs(xMouse - tooltip01_mc.x) < 1) {
        tooltip01_mc.x = xMouse;
    } else {
        tooltip01_mc.x -= (tooltip01_mc.x-xMouse) / 8;
    }
}
}
}

no, no errors, the script works fine accept for the fact that when the movie clip chases the mouse it is really jerky. I have got the: import scripts.TweenLite; in there but im not actually calling it because im not sure how.

Not sure why you’ve got import scripts.TweenLite; TweenLite should be kept in the original gs folder, so your import code should look like import gs.TweenLite; - That might help?

try something like this… I’m assuming your code was on the timeline, so this is as well. (I just put a clip called box on the stage);


import gs.TweenLite;
import fl.motion.easing.Quadratic;

this.stage.addEventListener(MouseEvent.MOUSE_MOVE, moveMouse);


function moveMouse(e:MouseEvent):void {
	TweenLite.to(box, .25, {x:mouseX, y:mouseY, ease:Quadratic.easeOut});
};

Sekasi - excellent, thank you so much!

Thanks! Bump!--------------------------------our wow gold site:buy wow gold, cheap [url=http://www.wowgoldcc.cn/wowgoldworld.htm]wow gold, free [url=http://www.wowgoldcc.cn/Newplayers.htm]wow gold,