Jump to content
Search Community

Any way to do this in TimelineLite or TimelineMax?

G. Scott test
Moderator Tag

Recommended Posts

Have tried to accomplish this many times but never succeeded and always too hurried to figure it out. Maybe someone can help.

 

Basically, append multiple where one of the "multiples" was an array and the other was not (or even another array?) So something like this. The code below doesn't throw any errors, but it also doesn't do anything...

 

timeline1.appendMultiple([new TweenMax([mc1, mc2, mc3, mc4], 1, {x:-100}), new TweenMax(mc5, 1, {alpha:1})]);

 

SO basically while mc1 - mc4 are moving left, I want mc5 to fade in. Like having a TweenMax.allTo inside an appendMultiple.

 

And if this is very doable and I just missed it somewhere, just blame it on th source code burned into my retinas...

 

THANKS!

Link to comment
Share on other sites

I just tried your code and it worked perfectly - could you post a very simple FLA that we could publish to see it NOT working? And you are using v12 of the animation platform, right? v11 couldn't have handled the array that you passed into a regular TweenMax, but v12 can.

Link to comment
Share on other sites

Being able to have your existing code work perfectly is one of many great reasons to upgrade to v12.

 

If for some reason you are stuck using v11, your code would need to be converted like so:

 

 

timeline1.appendMultiple(TweenMax.allTo([mc1, mc2, mc3, mc4], 1, {x:-100}));
timeline1.append(TweenMax.to(mc5, 1, {alpha:0}), -1);

 

In v11 if you want to tween multiple targets, you need to use TweenMax.allTo. in v12 a simple TweenLite.to() can tween multiple targets:

 

TweenLite.to([mc1, mc2, mc3], 1, {alpha:0})// v12 awesomeness

 

Also the reason a single appendMultiple() in v11 won't work is because appendMultiple() expects an array of tweens. TweenMax.allTo() creates an array of tweens which works perfectly, but you can not add in the final unique tween of mc5 as that would mean you are passing appendMultiple() an array of tweens + a single tween. No good.

 

As GreenSock mentioned, your code is good to go in v12 as appendMultiple() has been updated to support appending arrays of tweens combined with single tweens.

 

I strongly suggest that you upgrade to v12 as there are many more amazing benefits. Although it is technically still in BETA (due largely to the fact that the js version is still getting tested), the AS3 and AS2 versions are rock-solid.

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