# Follow mouse

**URL:** https://forum.kirupa.com/t/follow-mouse/3011
**Category:** Uncategorized
**Created:** [February 4, 2002, 5:14am UTC](https://forum.kirupa.com/t/follow-mouse/3011 "2002-02-04T05:14:54Z")
**Posts on this page:** 19
**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, 5:14am UTC](https://forum.kirupa.com/t/follow-mouse/3011/1 "2002-02-04T05:14:54Z")

</div>

Is there a way to hide the movie clip that follows the mouse when the mouse is not on the movie on followmouseeffects?

---

<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, 12:04pm UTC](https://forum.kirupa.com/t/follow-mouse/3011/2 "2002-02-04T12:04:56Z")

</div>

Can you explain that a little bi better please ?\rpom 0]

---

<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, 3:40pm UTC](https://forum.kirupa.com/t/follow-mouse/3011/3 "2002-02-04T15:40:22Z")

</div>

\<embed src=“[http://topelite.netfirms.com/follow.swf](http://topelite.netfirms.com/follow.swf)” width=200 height=200\>\</embed\>\r\rCan i only show that cross that follows the mouse only when the mouse is on the movie, so it isnt shown when the mouse it out?

---

<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, 3:55pm UTC](https://forum.kirupa.com/t/follow-mouse/3011/4 "2002-02-04T15:55:24Z")

</div>

maybe you could use \rmouseBounds = \_root.getBounds();\r\rif ((\_root.mouse\_mc.\_xmouse \> mouseBounds.xMax) ||\r(\_root.mouse\_mc.\_xmouse \< mouseBounds.xMin) ||\r(\_root.mouse\_mc.\_ymouse \> mouseBounds.yMax) ||\r(\_root.mouse\_mc.\_ymouse \< mouseBounds.yMin))\r{\r\_root.mouse\_mc.\_visible=false;\r}\relse\r{\r\_root.mouse\_mc.\_visible=true;\r}\r\rI can’t test it out right now. I hope it is okay. don’t hate me if it is wrong. or won’t work at all - Brian\r\r **EDITED: It is not working now, sorry. I will try to figure it out.** -Brian

---

<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, 4:05pm UTC](https://forum.kirupa.com/t/follow-mouse/3011/5 "2002-02-04T16:05:53Z")

</div>

Where do i put that in?\rAnd i think it contains some errors…

---

<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, 8:50pm UTC](https://forum.kirupa.com/t/follow-mouse/3011/6 "2002-02-04T20:50:24Z")

</div>

Nice script… I didn’t know that getBounds function. I think that it will work if you put () everywhere in your if test. You can put the code inside your clip that follows your mouse, for instance.\rpom 0]

---

<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 9, 2002, 11:20am UTC](https://forum.kirupa.com/t/follow-mouse/3011/7 "2002-02-09T11:20:18Z")

</div>

did you come up with a solution?

---

<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 9, 2002, 11:28am UTC](https://forum.kirupa.com/t/follow-mouse/3011/8 "2002-02-09T11:28:26Z")

</div>

Oh, I didn’t try !! Did you ? I’ll try later anyway.\r\rpom 0]

---

<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 12, 2002, 5:31am UTC](https://forum.kirupa.com/t/follow-mouse/3011/9 "2002-02-12T05:31:47Z")

</div>

bump… I’m gonna try that too… never heard of the \_bounds property

---

<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 12, 2002, 11:14pm UTC](https://forum.kirupa.com/t/follow-mouse/3011/10 "2002-02-12T23:14:27Z")

</div>

Ok, I’m getting crazy. I’m certain I answered that thread somewhere, only not in the good thread. Anyway, the solution is to set the clip invisible whenever the mouse gets to close to the border. Let’s say 5 pixels for instance. Can you do that by yourself from here ?\r\rpom 0]

---

<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 13, 2002, 6:17am UTC](https://forum.kirupa.com/t/follow-mouse/3011/11 "2002-02-13T06:17:28Z")

</div>

Its not important, i dont need it, but i need this…\r\rHow do you change to random color each time you roll over a button, or change to red, through actionscript?\r\rOr can i change to another image when rollin over a button?\r\rI want a button where the colors change every time i roll over it.

---

<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 13, 2002, 11:46am UTC](https://forum.kirupa.com/t/follow-mouse/3011/12 "2002-02-13T11:46:37Z")

</div>

U can use another MC that detect that if the mouse on it, and so tells the followin MC to be visible or not :\rlets assume that the detection MC called bg\_mc, and the other is follower\_mc\rput that on the bg\_mc\r\rif(this.hitTest(\_root.\_xmouse,\_root.\_ymouse,true)){\r\_root.follower.\_visible = true\r}else{\_root.follower.\_visible = 0\r}

---

<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 13, 2002, 2:38pm UTC](https://forum.kirupa.com/t/follow-mouse/3011/13 "2002-02-13T14:38:24Z")

</div>

didnt get it to work, can u send me a fla?

---

<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 13, 2002, 9:48pm UTC](https://forum.kirupa.com/t/follow-mouse/3011/14 "2002-02-13T21:48:05Z")

</div>

Farafiro, that method isn’t really interesting, since a simple on(rollover) would do. About that coor changing thing, I suggest you look at that tutorial on this very site :\r[www.kirupa.com/developer/…mcolor.asp](http://www.kirupa.com/developer/flash5/randomcolor.asp)\r\rpom 0]

---

<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 14, 2002, 5:24am UTC](https://forum.kirupa.com/t/follow-mouse/3011/15 "2002-02-14T05:24:49Z")

</div>

\*\* Farafiro, that method isn’t really interesting\*\*\r\rwell It might not be so but it solve the problem with an easy way, isn’t it ??\r\r\*\* helpmenow\*\*\rhow can I post a fla here

---

<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 14, 2002, 6:02am UTC](https://forum.kirupa.com/t/follow-mouse/3011/16 "2002-02-14T06:02:03Z")

</div>

use only the embed section of code, and click the box below your reply screen that says “HTML”. That will let you post an swf in here. As for an FLA, I think that you can only link to them.

---

<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 14, 2002, 9:09am UTC](https://forum.kirupa.com/t/follow-mouse/3011/17 "2002-02-14T09:09:03Z")

</div>

Still can’t do it but anyway here is a link to the fla\r\r[www.geocities.com/a\_fayek…pmenow.fla](http://www.geocities.com/a_fayek/flash/helpmenow.fla)

---

<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 14, 2002, 11:50am UTC](https://forum.kirupa.com/t/follow-mouse/3011/18 "2002-02-14T11:50:45Z")

</div>

Fara, you answered my first question about hiding the effect right?\rCool, well, it works.

---

<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 14, 2002, 3:34pm UTC](https://forum.kirupa.com/t/follow-mouse/3011/19 "2002-02-14T15:34:34Z")

</div>

Sorry Fara,\rI misunderstood what you were trying to do. I thought you were trying to solve that second problem, where the hittest method would be totally unappropriate.\rBut to solve the first problem, well, I guess it’s just the best way ! (I did it differently, but it sucked. Humm…).\r\rpom 0]
