Jump to content
GreenSock

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

looped clips all at once rather than one after the other

Recommended Posts

Hi there,

 

I'm not entirely sure if this is a TimeLineMax question or a general actionscript question but here goes anyway...

 

What I'm wanting to do is animate a set of MovieClips all at once rather than one after the other, what I've go so far is this...

var button:Array = [button1, button2, button3, button4, button5, button6, button7, button8];

var myTimeline:TimelineLite = new TimelineMax({repeat:-1, yoyo:true});

for( var i:int = 0; i < button.length; i++ ){

myTimeline.append(TweenMax.to(button[i], 1, {scaleX:1.2, scaleY:1.2, ease:Sine.easeIn}));
myTimeline.append(TweenMax.to(button[i], 1, {scaleX:1, scaleY:1, ease:Sine.easeIn}));

}

myTimeline.play();

Which almost works, in that it animates each clip one after the other, but what I actually want it to do is animate all the clips at the same time, would someone be able to explain where I'm going wrong in my code setup? :?

Thanks,

Squibn

Link to comment
Share on other sites

All you need to do is change your append() calls to insert(). append() will always add the tween to the end of the timeline. insert(), however, gives you complete control over the placement so you can overlap them as much as you want.

 

If you haven't watched it already, I'd strongly recommend taking a look at the video here: http://www.greensock.com/timeline-basics/

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