Ken Cross

Nested Timelines in Animate CC 2017

Recommended Posts

Hey guys!  Need a little assistance.  I'm having trouble with using nested timelines in Adobe Animate.  I'm unsure what the best approach is to execute a separate timeline within the main timeline.  I've attempted to use both a callback from a function, and just using .add() to put it within the timeline.  Can this be done?  I'm sure it can, just need someone more experienced to point out where I'm going wrong.  

 

Thanks in advance!

 

Here's the code:

var pw = new TimelineMax({repeat:-1})
	pw.add("begin")
	  .to(this.pc_tools_mc, .5, {x:-164, ease:Elastic.easeOut.config(1, 0.3)}, "+=1")
	  .to(this.pc_logo_mc, .5, { alpha:0 })
	  .from(this.dw_tools_mc, .5, {x:164, ease:Elastic.easeOut.config(1, 0.3)})
	  .from(this.dw_logo_mc, .5, { alpha:0 })
	  .set(this.pc_tools_mc,{x:164})
	  .to(this.dw_tools_mc, .5, {x:-164, ease:Elastic.easeOut.config(1, 0.3)})
	  .from(this.pc_tools_mc, .5, {x:164, ease:Elastic.easeOut.config(1, 0.3)})
	  .from(this.pc_logo_mc, .5, { alpha:0 })
	  .set(this.dw_tools_mc,{x:164});
	  .add("end")
	  
var tl = new TimelineMax()		  
tl.from(this.text1_mc, 1.5, { scaleX:0, scaleY:0, alpha:0, ease: Power1.easeIn },)
  .to([this.tree_mc2, this.tree_mc3, this.tree_mc4, this.tree_mc5, this.tree_mc6, this.text1_mc], 0.5, { alpha:0 }, "+=2")
  .to([this.text2_mc, this.lockup_mc], .5, { alpha:1 }, )
  .to([this.text2_mc, this.tree_mc], 0.5, {alpha:0 }, "+=2")
  .from(this.text3_mc, 0.5, { alpha: 0 },"+=0.5")
  .add(pw.tweenTo("end"))
  .to(this.lowes_mc, 0.5, { alpha:1 },)
  
this.stop();

 

Share this post


Link to post
Share on other sites

Hey, im a complete beginner but im still going to try and help you. Maybe you could try this:

Create a function like this:

 

function function1here() {    
  var tl = new TimelineLite();

// add the rest here
  return tl; // put this at the end.
}

 

function function2here() {    
  var pw = new TimelineLite();

  // add the rest here
  return tl; // put this at the end.
}

 

 

function createMasterTimeline() {
  timeline = new TimelineLite();
    .add(function1here())
    .add(function2here()) 
    timeline.timeScale(1)//used to control the speed of the timeline
}

 

// now call the mastertimeline function

 

createMasterTimeline()

 

now you should be able to do what you want and you can create the individual timelines

  • Like 3

Share this post


Link to post
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.