Jump to content
Search Community

insertMultiple with allFrom + single tweens

_maxxy test
Moderator Tag

Recommended Posts

Typically I'd use this:

TIM.insertMultiple([TweenMax.from(mc1, 1, {x:600}),
			        TweenMax.from(mc2, 1, {x:600}),
			        TweenMax.from(mc3, 1, {x:600})],0, TweenAlign.START, 2);

..for which I could use:

TIM.appendMultiple(TweenMax.allFrom([mc1,
						                mc2,
						                mc3], 0.75, {x:600},2))

 

The question is: Is there a way to use TimelineMax's appendMultiple/insertMultiple with a combination of allFrom (with an array for targetted movieclips) and another 'single' tween, e.g. like something below?

 

TIM.appendMultiple([TweenMax.allFrom([mc1,
								          mc2,
								          mc3], 0.75, {x:600},2),
				    TweenMax.to(mc4,0.5,{x:150})],0, TweenAlign.START,2);
//which doesn't work

 

Otherwise I guess the only way to launch tweens for mc1,mc2,mc3 & mc4 at a specific time of a timeline at the same time is:

 

TIM.insertMultiple([TweenMax.from(mc1, 1, {x:600}),
				      TweenMax.from(mc2, 1, {x:600}),
				      TweenMax.from(mc3, 1, {x:600}),
                   TweenMax.to(mc4,0.5,{x:150})],0, TweenAlign.START, 2);

 

..and even then, I wouldn't be sure how to start the mc1, mc2, mc3 tweens (sequenced) along with the tween for mc4 as it's all part of a single sequence now. Hope that makes sense.

 

Thanks a lot in advance!

m.

Link to comment
Share on other sites

also, for the initial use, which syntax should be used to gather the desired effect please? Both works, not quite sure what is the difference...

 

//1:
TIM.appendMultiple(TweenMax.allFrom([z2,z3,z4], 0.75, {x:600, ease:Expo.easeOut}),-.5, TweenAlign.START, 0.1);

//2:
TIM.appendMultiple(TweenMax.allFrom([z2,z3,z4], 0.75, {x:600, ease:Expo.easeOut, delay:-0.5},0.1));

 

 

in the first case, I'm not sure the TweenAlign needs to be present and in the second case I'm confident about the negative delay...

Thanks!

Link to comment
Share on other sites

Great questions!

 

I struggled a bit with these myself when starting with TimelineLite/Max.

 

The question is: Is there a way to use TimelineMax's appendMultiple/insertMultiple with a combination of allFrom (with an array for targetted movieclips) and another 'single' tween, e.g. like something below?

 

Nope. appendMultiple wants a single array of tweens, so you can not pass in an array AND and additional twen.

 

After you do your insertMultiple, you can then append() a single tween for mc4 and give it a negative offset value if you want it to start BEFORE the LAST tween in the previous insertMultiple() ends.

 

-----

 

//1:
TIM.appendMultiple(TweenMax.allFrom([z2,z3,z4], 0.75, {x:600, ease:Expo.easeOut}),-.5, TweenAlign.START, 0.1);

//2:
TIM.appendMultiple(TweenMax.allFrom([z2,z3,z4], 0.75, {x:600, ease:Expo.easeOut, delay:-0.5},0.1));

 

as you noticed these to lines do the same thing. some would prefer option 2 as there is less code. no wrong or right way.

 

 

let me know if that helps or if you need more explanation.

 

C

Link to comment
Share on other sites

The question is: Is there a way to use TimelineMax's appendMultiple/insertMultiple with a combination of allFrom (with an array for targetted movieclips) and another 'single' tween, e.g. like something below?

I suppose you could just use concat() like:

 

TIM.appendMultiple( TweenMax.allFrom([mc1, mc2, mc3], 0.75, {x:600},2).concat( TweenMax.to(mc4,0.5,{x:150}) ),0, TweenAlign.START,2);

Link to comment
Share on other sites

I love you guys, thanks for a great and a quick response from the both of ya :)

 

>>>>>

 

The question is: Is there a way to use TimelineMax's appendMultiple/insertMultiple with a combination of allFrom (with an array for targetted movieclips) and another 'single' tween, e.g. like something below?

I suppose you could just use concat() like:

 

TIM.appendMultiple( TweenMax.allFrom([mc1, mc2, mc3], 0.75, {x:600},2).concat( TweenMax.to(mc4,0.5,{x:150}) ),0, TweenAlign.START,2);

 

Awesome, didn't know about this. That does make life a little easier, however, I was wondering if there was a way to use this in a sense that it will start the tweens concurrently (mc1,mc2,mc3 sequenced + mc4) rather than add everything into one big array...?

 

At the moment, when I want at a particular time of a timeline to append an array of tweens which consists of allFrom array and 'single' tweens concurrently, I typically use the TIM.appendMultiple for the allFrom part and then TIM.insert with times delay to match the start of the allFrom tweens. I'm not aware of any other way this could be done.

 

Cheers

m.

Link to comment
Share on other sites

That does make life a little easier, however, I was wondering if there was a way to use this in a sense that it will start the tweens concurrently (mc1,mc2,mc3 sequenced + mc4) rather than add everything into one big array...?

I'm confused - isn't that exactly what that code does? Any tweens in that array will all start at the same time. Did I miss something?

Link to comment
Share on other sites

Well, I wanted to treat them as two bunches which start at the same time:

1st bunch = allFrom array

2nd bunch = the single tween

 

...and was trying to launch these simultaneously at a certain point in time of a timeline...

Makes sense?

Link to comment
Share on other sites

hi _maxxy,

 

I think the easiest way of starting a sequence and another unique tween at the same time in a timeline would look something like this.

 

//lets just use a bunch of tweens with funky times at the beginning:

TIM.append(TweenMax.to(apple, .5, {x:100}))
TIM.append(TweenMax.to(orange, 2.5, {y:100}))
TIM.append(TweenMax.to(grape, 3.75, {x:300}))
TIM.append(TweenMax.to(cherry, 12.51, {x:300}))
TIM.append(TweenMax.to(plum, 6.33, {x:300}))

//now to add a sequence and unique tween to start at the same time we need to know the placement in the timeline
//we don't want to add all those durations together

var insertionPoint:Number = TIM.duration;

TIM.insertMultiple([TweenMax.from(mc1, 1, {x:600}),
                   TweenMax.from(mc2, 1, {x:600}),
                   TweenMax.from(mc3, 1, {x:600})], insertionPoint, TweenAlign.START, 2);


TIM.insert(TweenMax.to(plum, 1, {rotation:90}), insertionPoint)

 

Does this seem like an ok solution to your problem? if not we'll keep trying.

 

best,

 

carl

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