# Adding Easing to (both ends of) a Mouse-controlled sliding menu?

**URL:** https://forum.kirupa.com/t/adding-easing-to-both-ends-of-a-mouse-controlled-sliding-menu/70747
**Category:** Uncategorized
**Created:** [November 17, 2004, 4:39am UTC](https://forum.kirupa.com/t/adding-easing-to-both-ends-of-a-mouse-controlled-sliding-menu/70747 "2004-11-17T04:39:24Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jullecool](https://avatars.discourse-cdn.com/v4/letter/j/ee59a6/32.png) [@jullecool](https://forum.kirupa.com/u/jullecool)
#### Post date: [November 17, 2004, 4:39am UTC](https://forum.kirupa.com/t/adding-easing-to-both-ends-of-a-mouse-controlled-sliding-menu/70747/1 "2004-11-17T04:39:24Z")

</div>

Hi, I really hope someone can help me with this ![](http://forum.kirupa.com/uploads/kirupa/798/c985a958819d8917.gif)

I have build a mouse-controlled sliding menu like the one on [[color=#22229c]http://www.flashlevel.com[/color]](http://www.flashlevel.com) (On their website they have 3 of them actually) My menu is just horizontal instead of vertical.  
Does anybody know how to add easing in both ends of a menu? I use this script in frame 1:

fscommand(“allowscale”, “false”);  
fscommand(“showmenu”, “false”);  
fscommand(“fullscreen”, “false”);  
xpicture = 0;  
film = 300;  
scrollmovement = 5;  
picture\_width = 705;  
name = “”;  
scroll = 1;

and this code in frame 2:

if (scroll == 1) {  
xmouse = \_xmouse-(film/2);  
speed = (xmouse)/scrollmovement;  
if (speed\<0) {  
speed = -(speed);  
}  
if (xmouse\<0) {  
xpicture = xpicture+speed;  
}  
if (xmouse\>0) {  
xpicture = xpicture-speed;  
}  
}

and in frame 3:

if (xpicture\>0) {  
xpicture = 0;  
}  
if (xpicture\<-(picture\_width-film)) {  
xpicture = -(picture\_width-film);  
}  
setProperty(“pictures”, \_x, xpicture);

I hope someone can tell me how to do it. I can attach the fla, if someone would have a look at it.  
thanks anyway  
cheers Jonas ![](http://forum.kirupa.com/uploads/kirupa/798/c985a958819d8917.gif)
