PDA

View Full Version : help with TweenMax !! onComplete



thebboydisorder
June 9th, 2008, 03:49 PM
I would like to go to a certain frame in my timeline after the last tween has finished!

what would the code look like
i kno it most likely will have a "onComplete"
somewhere in it most likely



import gs.TweenMax;

//what elsee?? =[

prg9
June 10th, 2008, 07:53 AM
I would like to go to a certain frame in my timeline after the last tween has finished! what would the code look like i kno it most likely will have a "onComplete" somewhere in it most likely

Welcome to Kirupa.

There is an example on the TweenMax page under Examples. Read the usage of TweenMax and you will be all set. http://blog.greensock.com/tweenmaxas2/


import gs.TweenMax;
import mx.transitions.easing.Back;
TweenMax.to(clip_mc, 5, {_alpha:50, _x:120, ease:Back.easeOut, delay:2, onComplete:onFinishTween, onCompleteParams:[5, clip_mc]});
function onFinishTween(argument1:Number, argument2:MovieClip):Void {
trace("The tween has finished! argument1 = " + argument1 + ", and argument2 = " + argument2);
}

jamesiliff
January 9th, 2011, 07:50 AM
Welcome to Kirupa.

There is an example on the TweenMax page under Examples. Read the usage of TweenMax and you will be all set. http://blog.greensock.com/tweenmaxas2/


import gs.TweenMax;
import mx.transitions.easing.Back;
TweenMax.to(clip_mc, 5, {_alpha:50, _x:120, ease:Back.easeOut, delay:2, onComplete:onFinishTween, onCompleteParams:[5, clip_mc]});
function onFinishTween(argument1:Number, argument2:MovieClip):Void {
trace("The tween has finished! argument1 = " + argument1 + ", and argument2 = " + argument2);
}

If so, can you please provide the code for AS3.

Thanks

TheCanadian
January 9th, 2011, 12:48 PM
Well you posted in the AS2 forum...

greensock
January 11th, 2011, 01:10 AM
There are lots of examples on the http://www.greensock.com site - pay special attention to the Plugin Explorer (http://www.greensock.com/tweenlite/#plugins). There is a Learning Resources (http://www.greensock.com/learning/) section of the site too with video tutorials and written ones. As far as that specific code goes, the AS3 would look like this:


import com.greensock.TweenMax;
import com.greensock.easing.Back;

TweenMax.to(clip_mc, 5, {alpha:0.5, x:120, ease:Back.easeOut, delay:2, onComplete:onFinishTween, onCompleteParams:[5, clip_mc]});
function onFinishTween(argument1:Number, argument2:MovieClip):void {
trace("The tween has finished! argument1 = " + argument1 + ", and argument2 = " + argument2);
}