# Stopping scroll menu at the end

**URL:** <https://forum.kirupa.com/t/stopping-scroll-menu-at-the-end/156052>\
**Category:** Uncategorized\
**Created:** [July 22, 2005, 2:35am UTC](https://forum.kirupa.com/t/stopping-scroll-menu-at-the-end/156052 "2005-07-22T02:35:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wdv](https://avatars.discourse-cdn.com/v4/letter/w/9fc29f/32.png) [@wdv](https://forum.kirupa.com/u/wdv)\
**Post date:** [July 22, 2005, 2:35am UTC](https://forum.kirupa.com/t/stopping-scroll-menu-at-the-end/156052/1 "2005-07-22T02:35:47Z")

</div>

hello i have a scroll menu that continously scrolls, i want the scolling to stop once it reaches the last button in the menu. does anyone know what script is need to stop it when it is at either end of the scroll?

this is the code I have on the scroll mc:

onClipEvent (mouseMove) {  
xmousepos1 = \_xmouse;  
ymousepos1 = \_ymouse;  
if (ymousepos1\>ymousepos2 && xmousepos1\>-347 && xmousepos1\<-282) {  
\_root.scrollclip.nextFrame();  
}  
if (ymousepos1\<ymousepos2 && xmousepos1\>-347 && xmousepos1\<-282) {  
\_root.scrollclip.prevFrame();  
}  
if (xmousepos1\<-347 || xmousepos1\>-282) {  
\_root.scrollclip.stop();  
}  
xmousepos2 = \_xmouse;  
ymousepos2 = \_ymouse;  
}
