ggalan Posted July 6, 2010 Share Posted July 6, 2010 how would you apply timeline to an array? i have 5 mc's on stage called mc1~mc5 , then stagger them import com.greensock.*; import com.greensock.easing.*; var timeline:TimelineLite = new TimelineLite(); var a:Array = []; for (var i:Number = 1; i <= 5; i++) { a.push(this["mc" + i]); } timeline.insertMultiple( TweenMax.allTo([a], 1, {tint:0x90E500, scaleX:.2, scaleY:.2}, 0.3), timeline.duration); Link to comment Share on other sites More sharing options...
GreenSock Posted July 6, 2010 Share Posted July 6, 2010 Sure, your code is okay - were you running into trouble? I'm not sure I understand your question. You can accomplish it many different ways. Here's another way: var timeline:TimelineLite = new TimelineLite(); for (var i:Number = 1; i timeline.insert( new TweenMax(this["mc" + i], 1, {tint:0x90E500, scaleX:.2, scaleY:.2}), i * 0.3); } Link to comment Share on other sites More sharing options...
ggalan Posted July 6, 2010 Author Share Posted July 6, 2010 it was the bracket around my array, the fix is this: timeline.insertMultiple( TweenMax.allTo(a, 1, {tint:0x90E500, scaleX:.2, scaleY:.2}, 0.3), timeline.duration); Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now