Jump to content
Search Community

TweenMax.allTo onInitAll?

Miroku_87 test
Moderator Tag

Recommended Posts

i'm 99% certain that there isn't a short way. as you probably found, adding onStart to the allTo gets applied to every tween.

 

if you put your allTo into a TimelineMax you have 2 options:

 

1: If the allTo is the first thing in the TimelineMax, add an onStart to the Timeline.

 

var tl:TimelineMax = new TimelineMax({paused:true, onStart:startMeUp});
tl.appendMultiple(TweenMax.allTo([mc, mc2], 2, {x:"100"}, .5));

tl.play();

function startMeUp(){
trace("go");
}

 

 

 

 

2 if your allTo is part of a larger sequence, use addCallback in your timeline prior to inserting the allTo

 

var tl:TimelineMax = new TimelineMax({paused:true});
tl.append(TweenLite.to(ball_mc, 2, {x:"200"}));
tl.append(TweenLite.to(ball_mc, 2, {y:"100"}));
tl.append(TweenLite.to(ball_mc, 2, {x:"100"}));


tl.addCallback(startMeUp, tl.duration);
tl.appendMultiple(TweenMax.allTo([mc, mc2], 2, {x:"100"}, .5));

tl.play();


function startMeUp(){
trace("go");
}

 

hope this helps.

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