# Follow mouse areas?

**URL:** <https://forum.kirupa.com/t/follow-mouse-areas/61820>\
**Category:** flash\
**Created:** [August 22, 2004, 5:36am UTC](https://forum.kirupa.com/t/follow-mouse-areas/61820 "2004-08-22T05:36:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![valpez1](https://avatars.discourse-cdn.com/v4/letter/v/958977/32.png) [@valpez1](https://forum.kirupa.com/u/valpez1)\
**Post date:** [August 22, 2004, 5:36am UTC](https://forum.kirupa.com/t/follow-mouse-areas/61820/1 "2004-08-22T05:36:26Z")

</div>

Sorry for the peculiar thread title; i didn’t know how to sum up my problem in a few words.

I have an mc, that i need to have follow the mouse on the x axis. I have that just fine. But my problem is that i need a certain frame within the mc to play if the mouse is at a certain area of the stage.  
For example, if the mouse is at the x coordinate of 235 to the left, frame 2 of the movieclip will play. I uploaded just a test fla that i was practicing on.

Thanks for any help whatsoever.

Take care,  
victor

---

<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:** [August 22, 2004, 9:01am UTC](https://forum.kirupa.com/t/follow-mouse-areas/61820/2 "2004-08-22T09:01:14Z")

</div>

if you compare two values you must not write if(a=b)  
because this gives a the value of b and if b is not 0,undefined or null the if always returns true!!!

i send you the .fla but i wrote that if x is bigger than the values then the frames are switched because it is very hard to point at a specific pixel with the mouse !

keep on trying!!

---

<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:** [August 22, 2004, 10:43am UTC](https://forum.kirupa.com/t/follow-mouse-areas/61820/3 "2004-08-22T10:43:55Z")

</div>

not having looked at your fla :S i dont know if youv already done this but if you want it in a certain area:

```auto
if(_root._xmouse < 250 && _root._xmouse > 150){}

```

Prophet.

---

<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:** [August 22, 2004, 2:18pm UTC](https://forum.kirupa.com/t/follow-mouse-areas/61820/4 "2004-08-22T14:18:53Z")

</div>

If it’s important for you to know exactly where the mouse is, use this:

```php
if(_root._xmouse <= 250 && _root._xmouse >= 150){
    // Tell the movie to go to the correct frame.
}

```

If you want it to go to a certain frame in either cases:

```php
if(_root._xmouse <= 250 || _root._xmouse >= 150){
    // Tell the movie to go to the correct frame.
}

```

---

<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:** [August 22, 2004, 3:39pm UTC](https://forum.kirupa.com/t/follow-mouse-areas/61820/5 "2004-08-22T15:39:00Z")

</div>

i take it you didnt read what he wanted then…

Prophet.

---

<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:** [August 22, 2004, 5:35pm UTC](https://forum.kirupa.com/t/follow-mouse-areas/61820/6 "2004-08-22T17:35:04Z")

</div>

Thanks a lot you all. It works a lot better now. :thumb:

Victor
