Tween class

i’m attempting to use the tween class to animate my menu system. I’ve got it all working except for the intro animation. I want the five nav elements to drop into place using the tween class. I’m using frames to delay the drop of subsequent menu items so that the first is about halfway through the tween before the second starts and so on… This works nicely but for some reason I have to import the tween and easing classes on every frame I have a tween:

import mx.transitions.Tween;
import mx.transitions.easing.*;

why is this? You’d think the tween/easing class would be available ‘movie-wide’ after it’s imported? no?

The problem is I also import the tween/easing classes on my last frame where I have my menu interaction all coded. Using the tween class on multiple frames like I have seems to be making my main navigation animations (tween class animations) run choppy now.

I could use keyframes, regular tweens I guess but I like the smooth fluidity of the tween class. maybe someone knows of a way to start a new tween halfway through the previous? sort of like “.onMotionHalfwayCompleted” instead of “.onMotionCompleted” !!!???

thanks for any input!

See: http://www.kirupa.com/forum/showthread.php?p=1795047#post1795047

As for the onMotionHalfWayFinished:

myTween.onMotionChanged = function():Void  {
 if (!this["OMHFBeacon"] && this.time > this.duration / 2) {
  this["OMHFBeacon"] = true;
  trace("onMotionHalfWayFinished");
 }
};

:hoser:

I usually write my tweens into functions on the first frame, with only as many tween variables as the max. no that will b running at one time. Then i just use the same variables in each function and only need to import once (for that clip). If i want to tween something in a later frame, i call the appropriate function.

thanks rafiman and northern neighbor.

I usually try to have most everything in the first frame too. or at least all in One frame anyway. Now that I know how to trigger the tweens halfway through I should be able to do that!

thanks folks!

:wink: