Jump to content
Search Community

TimelineLite align/stagger issue

isaacalves test
Moderator Tag

Recommended Posts

I want the tweens to be delayed from each other by 0.1 second.

 

var tl:TimelineLite = new TimelineLite({align: TweenAlign.NORMAL, stagger: 0.1});

var j:int;
for (var i:int; i < map.numChildren; i++) {
var mc:MovieClip = map.getChildAt(i);

j = 0;
for (j; j < mc.numChildren; j++) {
	tl.insert(TweenLite.from(mc.getChildAt(j), 1, {alpha: 0}));
        counter ++;
}
}

 

I tried using TweenAlign.SEQUENCE and stagger = -0.9 - I should get the same result right?

But they all start at the same time.. and if I use "append" they go on sequence - no stagger... what am I missing here?

 

Thanks in advance

Link to comment
Share on other sites

Hi,

 

I solved my problem using the offset parameter of the append method, as in this case nearly all tweens are appended in a for loop. So I'd still like to know why it didn't work the other way cause normally I'd like to use the 'stagger' properties of the timeline constructor.

 

tl.append(new TweenLite(mc.getChildAt(j), 1, {alpha: 1}), -.9); 

 

Thanks

Link to comment
Share on other sites

i've never used this method of setting an align mode in the constructor, but according to the documentation you ALSO need to pass in a tweens array into the constructor as well. Align modes set in the constructor don't seem to effect tweens that are later added.

 

align : String Only used in conjunction with the tweens special property when multiple tweens are to be inserted immediately through the constructor. The value simply gets passed to the insertMultiple() method. The default is TweenAlign.NORMAL. Options are:

TweenAlign.SEQUENCE: aligns the tweens one-after-the-other in a sequence

TweenAlign.START: aligns the start times of all of the tweens (ignores delays)

TweenAlign.NORMAL: aligns the start times of all the tweens (honors delays)

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