# AS motion tween

**URL:** <https://forum.kirupa.com/t/as-motion-tween/31071>\
**Category:** flash\
**Created:** [September 17, 2003, 11:03pm UTC](https://forum.kirupa.com/t/as-motion-tween/31071 "2003-09-17T23:03:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinnepin](https://avatars.discourse-cdn.com/v4/letter/v/c67d28/32.png) [@vinnepin](https://forum.kirupa.com/u/vinnepin)\
**Post date:** [September 17, 2003, 11:03pm UTC](https://forum.kirupa.com/t/as-motion-tween/31071/1 "2003-09-17T23:03:37Z")

</div>

Hey guys,

I got a question for u.

I have studied the tutorial on springs but i want to make something my own but i just cant figure it out :(.

Here’s the deal:

Lets say i have 2 menu items, 1 on the top and 1 at the bottom. And lets say there is a button to say it may go moving.  
When u press the button the menu at the bottom is going to move to the spot where menu at the top is.  
But the problem with this is that i want it to deaccelerate when it comes closer at the menu at the top.

I have figured out how to use the mouse follower with deacceleration :  
[AS]onClipEvent(enterFrame) {  
if (moving) {  
Xspeed = \_xmouse/20;  
Yspeed = \_Ymouse/20;  
this.\_x+=Xspeed;  
this.\_y+=Yspeed;  
}  
}[/AS]

But i cant seem to figure out how to use this code on the menu ☹

Do u know how??
