Reputation: 7219
I have a TimeLineMax sequence defined thus
var tl=new TimelineMax({paused: true});
tl.append(TweenMax.to(f, _flipSpeed, {rotationY: 90 + _offset, visible: false, onComplete:doneRotateF,ease:Linear.easeNone}))
tl.append(TweenMax.to(b, 0, {alpha: 1, immediateRender: false}))
tl.append(TweenMax.to(b, _flipSpeed, {rotationY: 0, onComplete:doneRotateB, ease:Linear.easeNone}));
When I call it using
tl.tweenTo(_tl.duration());
the callbacks work, are called, but when I try to reverse it
tl.tweenTo(0);
the tweens work but the callbacks are NOT called. What gives?
Upvotes: 1
Views: 2430
Reputation: 2885
Because for reverse you should use another callback - onReverseComplete
onReverseComplete : Function - A function that should be called when the tween has reached its beginning again from the reverse direction. For example, if reverse() is called the tween will move back towards its beginning and when its time reaches 0, onReverseComplete will be called. This can also happen if the tween is placed in a TimelineLite or TimelineMax instance that gets reversed and plays the tween backwards to (or past) the beginning.
Upvotes: 1