Jump to content
Search Community

How to make own tween for TweenMax.fromTo

Dieter test
Moderator Tag

Recommended Posts

Hey all,

 

I've been using Greensock libraries for a long time now. Today is the first time I had to use the fromTo method though.

With TweenLite package I could easily make a tween like this:

 

var myTween:TweenLite = new TweenLite(myMc, 1, {alpha:0});

 

How would I do this with the tweenTo method though? I need to do this for reverting the animation.

 

Thanks beforehand!

 

Cheers,

Dieter.

Link to comment
Share on other sites

hi,

 

I'm a little confused as first you mention fromTo() which is a method of TweenMax.

 

Later you mention tweenTo() which is a method of TimelineMax. I don't know what you mean by reverting the animation. do you mean reversing or re-setting?

 

please explain the exact effect or animation you wish to accomplish. thanks

 

-c

Link to comment
Share on other sites

@carl schooff

I'm sorry. I was a bit in a rush earlier so didn't completely explained myself.

 

I'm talking about the fromTo() method from the TweenMax library.

 

With reverting I indeed meant reversing.

 

I want to achieve what the transformAroundCenter does. Basically transform/scale a movieclip then reverse it after a certain amount of time. I thought I could do that by using the TweenMax library in OO principle.

Link to comment
Share on other sites

ok, that helps. start with something like:

 

TweenMax.fromTo(mc, 1, {alpha:0}, {alpha:1, repeat:1, repeatDelay:3, yoyo:true});

 

that tween will take 1 second to fade mc's alpha from 0 to 1. there will be a 3 second delay and then the tween will reverse.

 

i you have any questions about any part of that let me know.

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