Jump to content
Search Community

TweenMax multple tweens (Tweener man).

Grandpaw Broon test
Moderator Tag

Recommended Posts

So i really want to join the ranks of the TweenMax crew :D

 

One of the things im having trouble with is the concept of multple tweens on the same object.

 

 

//tweener

Tweener.addTween(object, {time:1, alpha:1})

Tweener.addTween(object, {delay:0.5, time:1, x:10, y:10});

 

 

This doesnt seem to work on TweenMax? Not the syntax, but the way i created 2 tweens on the same object with different properties and times and delays...... I used to chain these together for animated scenes and control exactly when i wanted each to fire based on delay.

 

 

So TimelineMax i believed was my next thing to check out..... I seen it has a Stagger property, but this propery is linar.. taking 5 buttons, i might want this:

 

button1 time:1 delay:1

button2 time:1 delay:1.12

button3 time:1 delay:1.68

button4 time:1 delay:3

button5 time:1 delay:7

 

 

Right now, using TimelineMax, button5 would take (time:4 + delay:13.80) As you can see however, my maximum delay should be 7. In other words. TimelineMax plays each append one after the other, and theres no finer control?

 

 

Does anyone have any idea what im talking about? lol

 

Or like take 1 button.....

 

button1, 0.5, {alpha:1} button1, 1, {scaleX:1, scaleY:1, delay:0.5}

 

Here i want to first fade in, and then scale up.... But the second call will override my alpha:1 Tween. Giving me a scaleX and scaleY at 1 but alpha:0

Link to comment
Share on other sites

HI Grandpaw Broon,

Welcome to Greensock!

 

TimelineLite/Max has a lot of control, you can stagger or sequence. This video might help you with the basics, the sequencing stuff is about 3/4's the way into the video (at '12:30 ish):

http://www.greensock.com/timeline-basics/

You can also see the documentation here:

http://www.greensock.com/as/docs/tween/

 

You could probably use "TweenAlign.START" for what you are looking to do, if I understand your query, but you would need to remove the delays.

 

With the overwriting of tweens, this would probably be an OverWrite Manager issue, with the defaults differing between TweenMax and TweenLite.

However, if you are using

TweenMax.to(mc,1,{alpha:1});
TweenMax.to(mc,1,{scaleX:1,scaleY:1, delay:0.5});

That should work as expected. (Assuming of course your mc is not already at those values!)

Have a look in the OverwriteManager documentation for a breakdown of the overwrite options:

http://www.greensock.com/as/docs/tween/ ... nager.html

 

Perhaps you can show us some code so we can see exactly where it's going wrong.

Link to comment
Share on other sites

what you want is totally possible.

 

you should read up on the insert() and append() methods

 

using insert() you can specify exactly what time the tween should start.

 

timeline.insert(TweenLite.to(mc, 1, {x:10})

timeline.insert(TweenLite.to(mc, 1, {y:10}, .2)

 

in the above code the y tween would start .2 seconds after the x tween begins.

 

using append() the default behavior is linear (one tween then the next and then next...) but there is also an offset value which can be positive or negative

 

http://www.greensock.com/as/docs/tween/ ... ml#append()

 

timeline.append(TweenLite.to(mc, 1, {x:10})

timeline.append(TweenLite.to(mc, 1, {y:10}, -.2)

 

in the above example the y tween would begin .2 seconds before the x tween ends

 

using insertMultiple or appendMultiple is like the above soaked in gasoline. EXPLOSIVE!

Link to comment
Share on other sites

Ahh excellent!

 

Thanks for your quick reply lads.

 

I was away from the net lastnight and i also noticed you can apply negative delays.... delay:-2

 

But the append offset property, or the inset method seems to be exactly what i am after so with this solved ill be able to start checking out all the features in the future!

 

Thanks for cleaning this up for me. And thanks Greensock :D

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