# Putting boundaries on a slider menu

**URL:** https://forum.kirupa.com/t/putting-boundaries-on-a-slider-menu/289384
**Category:** Uncategorized
**Created:** [May 29, 2009, 5:34pm UTC](https://forum.kirupa.com/t/putting-boundaries-on-a-slider-menu/289384 "2009-05-29T17:34:38Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![icekomo](https://avatars.discourse-cdn.com/v4/letter/i/bcef8e/32.png) [@icekomo](https://forum.kirupa.com/u/icekomo)
#### Post date: [May 29, 2009, 5:34pm UTC](https://forum.kirupa.com/t/putting-boundaries-on-a-slider-menu/289384/1 "2009-05-29T17:34:38Z")

</div>

Hey everyone,  
I’m having a hard time trying to figure out how to put boundaries on a slider menu I developed.  
Here is my code that I have:

var myShape:Shape = new Shape();  
myShape.graphics.beginFill(0x7E00E3);  
myShape.graphics.drawRect(0,-35,605,70);

addChild(myShape);  
menu\_mc.mask=myShape;

function movement(event:Event):void  
{  
menu\_mc.x = menu\_mc.x + (0.5\* myShape.width - mouseX) / 40;  
}

stage.addEventListener(Event.ENTER\_FRAME, movement);

it works great, but the menu system doesn’t stop, it just keeps on going. So far everything I have tried isn’t working. Any ideas?  
Thanks for the help!
