Jump to content
Search Community

Possible to *ease* the staggering of tweens in a FOR loop?

rynokins test
Moderator Tag

Recommended Posts

Hey - I have this FOR loop that tweens multiple objects in a movieclip, and uses the variable to calculate a delay like so:

 

for (var i:uint = 0; i < target_mc.numChildren; i++){
var delayTime:Number = (i*.1);
TweenLite.to(target_mc.getChildAt(i), 2, {x:"+50", ease:Circ.easeOut, delay:delayTime});
}

 

What I would like to do is somehow ease the delayTime so it staggers faster towards the last object tweening… is this even possible?

Thanks!

Link to comment
Share on other sites

Sure.

 

var total:int = target_mc.numChildren;
for (var i:uint = 0; i    var delayTime:Number = Cubic.easeOut(i, 0, total * 0.1, total);
  TweenLite.to(target_mc.getChildAt(i), 2, {x:"+50", ease:Circ.easeOut, delay:delayTime});
}

 

Change the Cubic.easeOut to whatever ease you want. And the 0.1 stagger value in there too.

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.
×
×
  • Create New...