Jump to content
Search Community

TimelineMax, TweenMax and looping a banner 2 times.

slayaz test
Moderator Tag

Recommended Posts

Hi Guys

 

I've been using Tween Max for a little while at a very basic level and it has been superb for doing ad banners (which is all the flash I get to to these days).

 

I got some help earlier regarding a banner by putting a loop command in, which works great, but was recommended TimeLineMax, but have tried to do it but I really struggle with the documentation.

 

I now want to move things on and do them properly, so i can use them as a template for future jobs

 

My code is below and I would appreciate some help. I quite like the though of using append to build the animation rather than delay, but whatever is the best solution.

 

Thanks again in advance for any help as it is much appreciated.

 

import com.greensock.*;

var timeline:TimelineMax = new TimelineMax({repeat:2, repeatDelay:1.5});

TweenMax.allTo([headone, headtwo, date, button], 0, {_alpha:0} );

TweenMax.allTo(headone, 2, {_alpha:100, delay:1});
TweenMax.to(headone, 2, {_alpha:0, delay:5});

TweenMax.to(headtwo, 2, {_alpha:100, delay:5});
TweenMax.to(date, 2, {_alpha:100, delay:9});

TweenMax.to(button, 2, {_alpha:100, delay:12});

 

P.S. The TimelineMax was added as an attempt to do the repeat but obviously it doesn't work.

 

Thanks again!

Link to comment
Share on other sites

when placing tweens in a TimelineLite/Max you have a few options, the most common are:

insert();

append();

 

if you don't specify where the tweens should be inserted... they will go at the beginning of the timeline.

 

insert(someTween, 2) will put some tween at the 2 secound mark

 

append() always places the tween at the end of the timeline. it is perfect for building sequences and you don't have to worry about delay.

with append() you can also specify how much of an offset should be applied to the insertion point

 

append(someTween, -.5) will put some tween .5 seconds before the end of the timeline

 

 

appendMultiple() must be used when your tween is an allTo() or allFrom()

 

your code could like something like this:

 

var timeline:TimelineMax = new TimelineMax({repeat:2, repeatDelay:1.5});

timeline.appendMultiple(     TweenMax.allTo([headone, headtwo, date, button], 0, {_alpha:0} )   );

timeline.append(    TweenMax.to(headone, 2, {_alpha:100, delay:1})    );
timeline.append(   TweenMax.to(headone, 2, {_alpha:0})    );

 

start small and experiment. Did you watch the TimelineMax video? http://www.greensock.com/timelinemax/ its a must.

 

TimelineMax has way too many features to discus in a single post, but hopefully this gets you on your way.

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