# Sticking and bouncing

**URL:** <https://forum.kirupa.com/t/sticking-and-bouncing/259892>\
**Category:** Uncategorized\
**Created:** [May 9, 2008, 8:06pm UTC](https://forum.kirupa.com/t/sticking-and-bouncing/259892 "2008-05-09T20:06:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![designhappy](https://avatars.discourse-cdn.com/v4/letter/d/a5b964/32.png) [@designhappy](https://forum.kirupa.com/u/designhappy)\
**Post date:** [May 9, 2008, 8:06pm UTC](https://forum.kirupa.com/t/sticking-and-bouncing/259892/1 "2008-05-09T20:06:39Z")

</div>

Hi,

Below is all of the code I have in a file for a scrollable menu. I am having problems with

-adjusting the scroll button to the size of the image that it moves

-making the scroll button stop scrolling when you release the click (now you have to clip it a second time to get it to stop following your mouse)

-stop bouncing, i’d rather have a plain scroll rather than the imag bouncing to a stop at the end.

Can you help?

[COLOR=RoyalBlue]movieclip.prototype.move = function () { dest = positiongeneral-\_root.drag.ratio\*\_root.drag.dxdrag;pos = this.\_x;this.\_x += (dest-pos)/7;};  
movieclip.prototype.move2 = function () { dest = positiongeneral-\_root.drag.ratio\*\_root.drag.dxdrag;pos = this.\_x;vel = (dest-pos)/7+vel\*0.7;this.\_x += vel;this.\_x += vel;};

onClipEvent (load) {  
\_y = \_root.pos.\_y ;  
\_x = \_root.pos.\_x -\_root.pos.\_width/2+\_width/2 ;  
positiongeneral = \_x ;  
}  
onClipEvent (enterFrame) {  
move2 () ;  
}

onClipEvent (load) {  
\_x = \_root.box.\_x-\_root.box.\_width/2+\_width/2 ;  
\_y = \_root.box.\_y ;  
ratio = \_root.general.\_width/\_root.box.\_width ;  
xold = \_x;  
}  
onClipEvent (enterFrame) {  
if (dragging) {  
if((\_root.\_xmouse\>\_root.box.\_x-\_root.box.\_width/2) and (\_root.\_xmouse\<\_root.box.\_x+\_root.box.\_width/2)) {  
\_x = \_root.\_xmouse ;  
dxdrag = \_x - xold ;  
}  
}  
}  
[/COLOR]
