# MC follows the cursor. How to restrict the MC movement and not the cursor?

**URL:** <https://forum.kirupa.com/t/mc-follows-the-cursor-how-to-restrict-the-mc-movement-and-not-the-cursor/227930>\
**Category:** flash\
**Created:** [June 4, 2007, 12:40am UTC](https://forum.kirupa.com/t/mc-follows-the-cursor-how-to-restrict-the-mc-movement-and-not-the-cursor/227930 "2007-06-04T00:40:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BeefyButcher](https://avatars.discourse-cdn.com/v4/letter/b/ecae2f/32.png) [@BeefyButcher](https://forum.kirupa.com/u/BeefyButcher)\
**Post date:** [June 4, 2007, 12:40am UTC](https://forum.kirupa.com/t/mc-follows-the-cursor-how-to-restrict-the-mc-movement-and-not-the-cursor/227930/1 "2007-06-04T00:40:44Z")

</div>

I am trying to make something similar \*\*[to this idea](http://www.kirupa.com/developer/flash5/follow.htm) \*\*but my MC has a couple of buttons that follow the standard cursor - which is not hidden.  
The movieclip movement is working by using:

```auto
onClipEvent (enterFrame) {
    this._x += (_root._xmouse-this._x)/25;
    this._y += (_root._ymouse-this._y)/25;
}

```

At the moment with this code, the button mc follows the mouse over the entire stage. I am trying to figure out how I can limit the movement to a smaller proportion of the stage, by either a hit area or some other method :-/  
Obviously I wont want this to effect the normal cursor movement, just the MC that follows it. Anyone give me a clue of how I should go about trying to do this?  
Thanks
