Jump to content
Search Community

allTo option for TweenLite?

timaging test
Moderator Tag

Recommended Posts

I was just searching through the forums to find out if my array was broken and ran across this:

 

"TweenLite doesn't have an allTo(), but TweenMax does (as of v11)."

 

but I need it to work in TweenLite because the file size doubles and over the banner ad size limit.

 

so, how do we do this in TweenLite:

 

var allClips:Array = [wordLine01];
TweenLite.allTo(allClips, 0, {autoAlpha:0});

 

thanks-

Dave

Link to comment
Share on other sites

THIS is outstanding news. As Always, Thank You Mr. Schoof!!!!!!!

 

 

 

Hi Dave,

 

You can use v12 of GSAP for AS3/AS2 and expect 0 problems. In v12 you can use a simple TweenLite.to() to tween multiple targets like so:

 

TweenLite.to(allClips, 0, {autoAlpha:0});

 

Learn more about the enhancements and new features of v12 here: http://www.greensock.com/v12/

Link to comment
Share on other sites

It sounds like there must be some other problem in your file - can you post a very simple FLA that demonstrates the issue so that we can publish on our end? It doesn't need to be your production file(s) - just something super simple. Are you getting any errors? AS2 or AS3?

Link to comment
Share on other sites

It looks like you just had some errors in your code. Your array only had wordLine01 repeated a bunch of times like [wordLine01, wordLine01, wordLine01...] instead of incrementing like [wordLine01, wordLine02, wordLine03...]. Another problem is that you used autoAlpha to make them all invisible and alpha 0, but then when you were trying to fade up the alpha in your TimelineLite, you only used alpha instead of autoAlpha, so the alpha was tweened perfectly but you'd never see anything because their "visible" property was still "false". I think you meant to do something like this:

 

var allClips:Array = [wordLine01, wordLine02, wordLine03, wordLine04, wordLine05, wordLine06,
                     wordLine07, sloanLogo, glowBar];
TweenLite.to(allClips, 0, {autoAlpha:0});

var timelineMain:TimelineLite = new TimelineLite({repeat:0});

timelineMain.appendMultiple([new TweenLite(sloanLogo,  2, {autoAlpha:1, ease:Cubic.easeIn}),
					   new TweenLite(glowBar,  2, {autoAlpha:.4, ease:Cubic.easeIn}),
					   new TweenLite(wordLine07,  2, {autoAlpha:1, ease:Cubic.easeIn}),
					   new TweenLite(wordLine06,  2, {autoAlpha:1, ease:Cubic.easeIn}),
					   new TweenLite(wordLine05,  2, {autoAlpha:1, ease:Cubic.easeIn}),
					   new TweenLite(wordLine04,  2, {autoAlpha:1, ease:Cubic.easeIn}),
					   new TweenLite(wordLine03,  2, {autoAlpha:1, ease:Cubic.easeIn}),
					   new TweenLite(wordLine02,  2, {autoAlpha:1, ease:Cubic.easeIn}),
					   new TweenLite(wordLine01,  2, {autoAlpha:1, ease:Cubic.easeIn})], 0, TweenAlign.START, 0.1);

stop();

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