完成补间后,我想更改我的变量,然后只有我的鼠标移动会开始运行一些函数,但似乎 onComplete 函数立即触发了所有事情。不是 onComplete 函数只会在动作完成后运行吗?运行 Tween.to 代码行后还有其他喜欢的方式,只有它会运行第二行更改变量?
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});
}
}