سؤال

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?

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top