Jump to content
Search Community

A structural insertMultiple Problem

jmomandown test
Moderator Tag

Recommended Posts

First off I am highly impressed with the library. I am coming over from a php/mysql but avoid flash if possible background haha. The ease of the GreenSock library has grasped my interest. I am exploring the power of the library but it has given me a problem in this particular instance. So I am trying to get two completely separate functioning tweens to preform at the same time. This is all in a stream of tweens. The below is how the action is intended to preform

 

timeline.insertMultiple( TweenMax.allFrom(letters, 1.1, {y: "-410", alpha:0, ease:Elastic.easeOut}, 0.02), 1.4)
timeline.append( new TweenLite(red, .8, {y:"-270", ease:Elastic.easeIn}));
timeline.append( TweenLite.to(yellow, .8, {y:"-290"}));

 

The second and third tweens need to begin at the same time. I understand you can use insertMultiple to accomplish that, the issue is that it brings the Tween set to the present state of the timeline. I still want them to run after the first Tween string. I understand you can accomplish this with a delay on the second insertMultiple, but for learning purposes is there a better structural way to do it? Perhaps I am getting tired and missing the obvious structural solution

Link to comment
Share on other sites

appendMultiple is what you need:

 

timeline.insertMultiple( TweenMax.allFrom(letters, 1.1, {y: "-410", alpha:0, ease:Elastic.easeOut}, 0.02), 1.4)
timeline.appendMultiple([ new TweenLite(red, .8, {y:"-270", ease:Elastic.easeIn}),
                                     TweenLite.to(yellow, .8, {y:"-290"} ) ] )

 

the 2 tweens inside the appendMultiple will start at the same time immediately after the first group of insertMultiple tweens finishes.

you can offset their start times, sequence them, overlap them and have amazing control with the optional offset, tweenAlign and stagger props. I omitted them because the default behavior is what I think you want.

 

for more info on appendMultiple watch:

http://active.tutsplus.com/tutorials/an ... equencing/

 

and read: http://www.greensock.com/as/docs/tween/ ... dMultiple()

 

hope this helps. have fun.

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