Smooth menu animation - FMX

Hi,
I have a menu in which when you click on a button, a rectangle moves up or down to sit behind the button clicked on (to highlight it).
I was wondering how I can make the rectangle move smoothly as in the tutorial where the ball follows the mouse.
Here is the code I have used:-

Actions layer-
Frame 1:
currenty = -50;
yto = -50;

Frame 2:
if (currenty == yto) {
} else if (currenty<yto) {
setProperty(bar, _y, bar._y+10);
currenty = bar._y;
} else if (currenty>yto) {
setProperty(bar, _y, bar._y-10);
currenty = bar._y;
}

Frame 3:
gotoAndPlay(2);

And for each button-
on (release) {
yto = -50;
_root.contents.loadMovie(“demopage.swf”);
}

With ‘yto’ specifying the location to move to…

This all works fine, I just cannot work out how to get that smooth springy movment as the the ‘Mouse Follow with Easing’ tutorial…

Sorry for the long post, just wanted to give a full picture :wink:
thankyou

jay

easing!!! Thats the word I was looking for when I said smooth, springy movement…
:stuck_out_tongue:

Maybe this can help some:

You can do this by a fairly simple if statement.
_root.speed = .2; // keep it low, prob. less than 1.
If(currenty != yto){
If(currenty > yto){
currenty -= speed;
}Else If (currenty < yto){
currenty += speed;
}
}
I usually do things like accleration in movie clips so that you can put all this code into an OnEnterFrame() event, it usually turns out easier. I hope this helps you. This code might not be perfect, but you can see the logic in it.