# Limiting scrolling

**URL:** https://forum.kirupa.com/t/limiting-scrolling/109305
**Category:** Uncategorized
**Created:** [May 4, 2004, 12:07pm UTC](https://forum.kirupa.com/t/limiting-scrolling/109305 "2004-05-04T12:07:24Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Pat\_Begg](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@Pat\_Begg](https://forum.kirupa.com/u/Pat_Begg)
#### Post date: [May 4, 2004, 12:07pm UTC](https://forum.kirupa.com/t/limiting-scrolling/109305/1 "2004-05-04T12:07:24Z")

</div>

Hi all,  
Another quick one, I think simple though.  
I have a mc that scrolls left or right depending on the \_x position of the mouse. What I need is to limit where the mc can scroll to i.e. so it doesn’t just keep scrolling off the screen.

Code:

stop();  
\_root.onEnterFrame = function() {  
\_root.cad\_menu\_1.cad\_menu.\_x = \_root.cad\_menu\_1.cad\_menu.\_x+(.5\*Stage.width-\_xmouse)/70;  
};

As always help is much appreciated, cheers
