Jump to content
Search Community

timeline array

ggalan test
Moderator Tag

Recommended Posts

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

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

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...