Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
danissimo

Pause nested Timeline

Recommended Posts

I'm trying to pause nested timeline:

prezStartTimeline.call (buttonsHomeOff)
		 .to ([_rootRef.overlay, _rootRef.bottomPlate], 0.5, {autoAlpha:1, ease:Linear.easeNone, onComplete:function():void {backdropLoader.pauseVideo(); _rootRef.backdrop.visible = false;}})
		 .staggerFromTo ([_rootRef.buttonHome, _rootRef.buttonBack, _rootRef.buttonForward], 0.5, {y:"+=20"}, {y:"-=20", autoAlpha:1, ease:Cubic.easeOut, onComplete:buttonsPrezOn}, 0.1)
		 .add (RAOTimeline);

RAOTimeline.addLabel ("slide_01")
	   .staggerFrom ([_rootRef.prezRAO.item_01, _rootRef.prezRAO.item_02, _rootRef.prezRAO.item_03], 0.5, {y:"+=20", alpha:0, ease:Cubic.easeOut, onComplete:buttonsPrezOn}, 0.1)
	   .addLabel ("slide_02")
	   .addPause ("slide_02")
	   .to ([_rootRef.prezRAO.item_01, _rootRef.prezRAO.item_02, _rootRef.prezRAO.item_03], 0.5, {alpha:0, ease:Linear.easeNone})
	   .to (_rootRef.logoSmall, 0.5, {y:"-=20", autoAlpha:1, ease:Cubic.easeOut})
	   .staggerFrom ([_rootRef.prezRAO.item_04, _rootRef.prezRAO.item_05, _rootRef.prezRAO.item_06, _rootRef.prezRAO.item_07, _rootRef.prezRAO.item_08], 0.5, {y:"+=20", alpha:0, ease:Cubic.easeOut, onComplete:buttonsPrezOn}, 0.1, "-=0.4")

But when I again play child timeline after the pause (.play()), the playhead is already at the end of the child timeline (all objects are already animated to the end values). Looks like the values calculations don't stop at the pause position. Is it a bug or did I miss anything?

Link to comment
Share on other sites

It sounds like you don't have smoothChildTiming enabled on your parent timeline. By default (and this is very intentional), child tweens/timelines inside of a TimelineLite/Max will maintain their position on their parent timeline, ensuring that everything is locked into place and doesn't shift around. In your case, you WANT its position to move, thus you need to either manually change its startTime() yourself or (probably easier), just set smoothChildTiming to true on the parent. Simple example:

var master = new TimelineLite({smoothChildTiming:true});
var child = new TimelineLite();
master.add(child);

Now if you pause/resume child, its timing will be adjusted so that its local playhead lines up with the parent timeline's playhead. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×