After I finish a tween, I would like to change my variables, then only my mouse movement would have start to run some functions, but it seems like the onComplete function fired immediately messing all the things out. Isnt't that onComplete function will only run after an action is done? Any other way to like after running the Tween.to line of code, only it will ran the 2nd line changing a variable?
stage.addEventListener(MouseEvent.MOUSE_MOVE, movevC);
public static function showSection(obj:DisplayObject):void {;
var sect2X=((obj.stage.stageWidth/2)+(obj.stage.stageWidth/4))+lg.width;
var sect2Y=((obj.stage.stageHeight/2)-(obj.stage.stageHeight/4))+lg.height;
switch (obj.name) {
case "section2" :
//onComplete run instantly??
TweenLite.to(vC, 10, {x:sect2X, y:sect2Y, rotation:0,ease:Elastic.easeInOut, onComplete:currentPage=2});
/*if ((vC.x=sect2X)&&(vC.y=sect2Y)) {
currentPage=2;
}*/
break;
}
}
private function movevC(event:MouseEvent):void {
if (currentPage==2) {
TweenLite.to(vC, 2, {x:mouseX, y:mouseY});
}
}