Jump to content
Search Community

Tween more than one Object with a single TweeLite.to

vyger test
Moderator Tag

Recommended Posts

Hi, is there any way to Tween more than one Object with a single line of code?

 

Eg. one object:

TweenLite.to(mc1, 2, {alpha:0.5});

 

More Objects:

TweenLite.to([mc1,mc2,mc3], 2, {alpha:0.5});

 

Thanks in advance.

Link to comment
Share on other sites

Hi, thanks for your kind reply. One more question: if I use TweenMax, does my swf grow in size?

Yep, with more features comes more kb. It's all explained on the web site (http://www.greensock.com/tweenmax/). If you need the smallest file size, stick with TweenLite and do a simple loop:

 

var myObjects:Array = [mc1, mc2, mc3];
for (var i:int = 0; i     TweenLite.to(myObjects[i], 2, {alpha:0.5});
}

Link to comment
Share on other sites

Ok, I think I'll leave the 2 TweenLite.to calls (I only have 2 movieclips) because TweenMax, as I imagined, comes with the drawback of size and the loop idea converts my 2 lines to 4. Thank you very much indeed.

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