Jump to content
Search Community

TimelineMax append allTo

jr_blackridge test
Moderator Tag

Recommended Posts

Can you explain how to correctly do the following?

I want to fade in an array and animate them, and fade them out as they come to the end, but my attempts to appendMultiple for the fade out seem to either overwrite the initial values, or is pre-appending them ? I'm stymied.

 

import com.greensock.*;

import com.greensock.easing.*;

import com.greensock.plugins.*;

TweenPlugin.activate([bezierPlugin]);

 

t1 = new TimelineMax();

var ballArr:Array = [ball1,ball2,ball3,ball4,ball5,ball6];

 

//fade in and animate, offset both by .25

//works great

t1.appendMultiple([TweenMax.allFrom(ballArr, .25, {_alpha:0}, .25),

TweenMax.allTo(ballArr, 1.5, {bezier:[{_x:515, _y:44}, {_x:485, _y:200}]}, .25)]);

 

// append an allTo() to the end of the timeline -- should place new tweens at the end of the timeline?

// doesn't work. Seems to overwrite initial values in the timeline, and the offset

var offsetVal = 3

t1.appendMultiple(TweenMax.allTo(ballArr, .25, {_alpha:0}, .25), offsetVal )

// or some variation of this

t1.appendMultiple([TweenMax.allTo(ballArr, .25, {_x:0}, .25)], offsetVal )

Link to comment
Share on other sites

try something more like this:

 

t1.appendMultiple(TweenMax.allFrom(ballArr, .25, {_alpha:0}, .25));
tl.insertMultiple(TweenMax.allTo(ballArr, 1.5, {bezier:[{_x:515, _y:44}, {_x:485, _y:200}]}, .25))


t1.appendMultiple(TweenMax.allTo(ballArr, .25, {_alpha:0}, .25), 1);

 

i may have screwed up your timing in my experiments but you should be able to tweak it back to what you wanted.

 

----

 

the reason you were getting wonky results was because you were misusing appendMultiple.

 

appendMultiple() expects a single array of tweens.

allFrom() creates a single array of tweens.

 

when you were doing an allFrom() AND an allTo() inside appendMultiple() you were creating an array that contained 2 arrays of tweens.

 

you can read more about this here: viewtopic.php?f=1&t=6191#p23921

 

it can be a little tough to wrap your head around at first, but hopefully this helps.

Link to comment
Share on other sites

  • 1 month later...

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