Jump to content
Search Community

onComplete event for end of animation of an Array

Naomi Spirit test
Moderator Tag

Recommended Posts

I'm using the staggerto, staggerfrom functions to animate Arrays.  I see that the onComplete function gets called after each object in the Array has finished (returning that object).  I would like a function which gets called once all have finished, and which returns the Array, but can't seem to find one?!  I wonder if I am just missing something?  I found an onCompleteAll but this gives me errors.

 

Thankyou!  Naomi

Link to comment
Share on other sites

Hi and welcome to the GreenSock forums,

 

Here is a basic sample of how to call an onCompleteAll callback and pass params:

 

import com.greensock.*;


var mcs:Array = [mc1, mc2]
//targets array, duration, vars, stagger, onCompleteAll, onCompleteAllParams
TweenMax.staggerFrom(mcs, 1, {alpha:0, onComplete:onCompleteHandler}, 0.2, onCompleteAllHandler, [mcs]);




function onCompleteHandler() {
trace("a single tween is complete");
}


function onCompleteAllHandler(array:Array) {
trace("all done tweening " + array); 
}

If this doesn't help please post the code or sample file that illustrates the errors.

 

 

 

onCompleteAll_CS5.zip

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