Is it possible ( with actuate ) to start another tween ( for the same object ) after the first one is finished ?
I know for onComplete( … ) , but looking for other solution . Here is example : https://try.haxe.org/#1c82d
class Test {
static function main() {
var point:Point = new Point();
Actuate.tween(point, 1, { x: 10 }).onUpdate(function() { trace("x(1): "+point.x); });
// ..... some code
//..... some code
Actuate.tween(point, 2, {x:15, y:5},false).onUpdate(function() { trace("x(2): "+point.x); }).delay(1);
}
}
In this example I use a hack ( set delay to 1 second , the same time as the first tween),.
Is there some other method which will start the second tween after the first is finished ?
I’d be curious to know why onComplete won’t do the trick, but perhaps you could run a constantly going test on “point” and when x is 10, trigger the next animation. You could tie it to a Timer function or do stage.addEventListener(Event.ENTER_FRAME, stage_onEnterFrame);
Thanks to everyone for the help.
Maybe I will stick with delay . Other solution which I tried was with MotionPath, but there have some delay between first .line(x1, y1) and the second one .line(x2,y2) . This is because when tween approach x1 the change is less than a pixel and there is visible stop of the motion
About why onComplete won’t work for me :
My example above is not the real situation. In reality I have If / else statements ( for the first Actuate.tween ) with some calculation and different start / stop x/y , but the second tween is always the same ( well with different start/stop depending from the if/else above),
Its for sequencing animations (gsap like) in Actuate tweening engine. It doesn’t support everything Actuate does, but it’s easy to use and works well for standard tweens.