Jump to content
Search Community

Trouble with timeline

jajohns8 test
Moderator Tag

Recommended Posts

First off, great set of classes you have.

 

I am trying to make a sequence of tweens using timeline, but I can't seem to get the onComplete function to fire.

 

I basically want a tween that repeats infinitely, but at the end of that tween' sequence, (before the repeat) I want it to initiate another tween on another object.

At first I tried to append to timeline1, but that wasn't working, so I went with onComplete.

The first tween works fine, but the call to the onComplete function fails. (Maybe the fact that it repeats is messing it up?)

 

var timeline1:TimelineMax = new TimelineMax({repeat:-1, repeatDelay:30, delay:3});
timeline1.append( new TweenMax(myText2, 2, {x:131, alpha:1, ease:Back.easeOut, repeat:-1, yoyo:true, onComplete:finTween, 
						   onCompleteParams:[360, myR], repeatDelay:10}) );

 

function finTween(param1:Number, param2:MovieClip):void {

 TweenLite.to(param2, 1, {rotation:param1, overwrite:false});;

}

Link to comment
Share on other sites

you may want to use the onRepeat & onRepeatParams function instead of onComplete& onCompleteParams

 

Exactly correct. onComplete won't fire until the entire tween (including all repeats/yoyos) has completed. In your case that'll never happen because you have it repeating forever. You probably want the onRepeat instead.

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