下面的代码,使用TweenMax的onUpdate方法
this.detaibaseInfo2 = new Sprite(); with (detaibaseInfo2) { x = 30; y = 700; with (graphics) { beginFill(0x826b45, 1); drawRect(0, 0, 240, 20); endFill(); } } addChild(detaibaseInfo2); TweenMax.to(detaibaseInfo2, 0.2, {y:260, onUpdate:detaibaseInfo2Update,ease:Strong.easeOut});
但是测试了一下:
private function detaibaseInfo2Update():void { trace("detaibaseInfo2.y="+detaibaseInfo2.y); if (detaibaseInfo2.y < 270) { other code ... } }
输出的结果是:
[trace] detaibaseInfo2.y=399.7[trace] detaibaseInfo2.y=399.7[trace] detaibaseInfo2.y=399.7[trace] detaibaseInfo2.y=399.7[trace] detaibaseInfo2.y=399.7[trace] detaibaseInfo2.y=291.45[trace] detaibaseInfo2.y=263.25[trace] detaibaseInfo2.y=260.05[trace] detaibaseInfo2.y=260
潇潇雨雨
慕莱坞森