# Ive confused myself. Again

**URL:** https://forum.kirupa.com/t/ive-confused-myself-again/3493
**Category:** Uncategorized
**Created:** [February 4, 2002, 11:31pm UTC](https://forum.kirupa.com/t/ive-confused-myself-again/3493 "2002-02-04T23:31:12Z")
**Posts on this page:** 5
**Page:** 1

<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: [February 4, 2002, 11:31pm UTC](https://forum.kirupa.com/t/ive-confused-myself-again/3493/1 "2002-02-04T23:31:12Z")

</div>

Ive got an mc that has this scripting on it,  
onClipEvent (enterFrame) {  
\_y = \_root.\_xmouse;  
}  
which makes it follow the mouse, but what i need now is for the mc to stop moving when the mouse reaches a certain point on the stage. Could a button and tell target do this?

---

<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: [February 4, 2002, 11:53pm UTC](https://forum.kirupa.com/t/ive-confused-myself-again/3493/2 "2002-02-04T23:53:33Z")

</div>

Fish,  
I don’t know, i am sure it’s possible. I will be listening in on this one as I would like to also know if you can make it stop by a timer or when it gets out of a certain area. I am sure its possible but don’t know how. Perhaps Upuaut or Pom would know the script for that.

pj

---

<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: [February 5, 2002, 12:20am UTC](https://forum.kirupa.com/t/ive-confused-myself-again/3493/3 "2002-02-05T00:20:37Z")

</div>

yell at your computer, or turn it off, then it’ll stop following the mouse.

---

<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: [February 5, 2002, 12:24am UTC](https://forum.kirupa.com/t/ive-confused-myself-again/3493/4 "2002-02-05T00:24:58Z")

</div>

hopefully the area you want the mouse to be followed in is a square:

say you wanted the MC to follow the mouse within the range of 100x100 pixels, top left corner of your screen. this would be the script:

onClipEvent(enterFrame) {  
if (\_root.\_xmouse \> 0 && \_root.\_xmouse \< 100) {  
if (\_root.\_ymouse \> 0 && \_root.\_ymouse \< 100) {  
\_x = \_root.\_xmouse;  
\_y = \_root.\_ymouse;  
}  
}  
}

that is a very basic script. hopefully you’ll understand what that means.

---

<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: [February 5, 2002, 12:26am UTC](https://forum.kirupa.com/t/ive-confused-myself-again/3493/5 "2002-02-05T00:26:37Z")

</div>

what you could also do is take a sledgehammer…or even a simple drill…
