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;
}
}
}
}