# Restricting the Mouse

**URL:** https://forum.kirupa.com/t/restricting-the-mouse/5768
**Category:** flash
**Created:** [September 21, 2002, 8:09am UTC](https://forum.kirupa.com/t/restricting-the-mouse/5768 "2002-09-21T08:09:07Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![bcogswell11](https://avatars.discourse-cdn.com/v4/letter/b/8e7dd6/32.png) [@bcogswell11](https://forum.kirupa.com/u/bcogswell11)
#### Post date: [September 21, 2002, 8:09am UTC](https://forum.kirupa.com/t/restricting-the-mouse/5768/1 "2002-09-21T08:09:07Z")

</div>

Hey guys, a simple question I hope. 🙂 How can you restrict the mouse so that users cannot move thir mouse into a certain area, (or a certain y or x value)? This is useful to me because I need it for a game.

Thanks!  
-brad-

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [September 21, 2002, 11:25am UTC](https://forum.kirupa.com/t/restricting-the-mouse/5768/2 "2002-09-21T11:25:21Z")

</div>

You cant do it , poinet is uncontrolable… all you can do. is wach there the mouse is… …

I sugest you do that… hide the mose in that area…

if you want dont confuse users… you can drow mouse pointer image and put it in the edge of the area ,in the spot there mouse enters “black” area and is hidin…  
then user drags away the mouse from that area… unhide mouse and delete that phantom mouse…

🙂 hope that will help…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [September 21, 2002, 12:05pm UTC](https://forum.kirupa.com/t/restricting-the-mouse/5768/3 "2002-09-21T12:05:19Z")

</div>

Strictly speaking you can’t limit the mouse movements but …

if you substitute an MC for the mouse

mc.\_x=\_xmouse  
mc.\_y=\_ymouse  
Mouse.hide()

then specify allowable x,y coords

if (\_x\>=300) {  
\_x=300;  
}

and use the updateAfterEvent(mouseMove);

it’ll look just like it’s locked
