# Neat mouse follower

**URL:** https://forum.kirupa.com/t/neat-mouse-follower/263649
**Category:** Uncategorized
**Created:** [June 17, 2008, 11:32pm UTC](https://forum.kirupa.com/t/neat-mouse-follower/263649 "2008-06-17T23:32:27Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![cooldude88](https://avatars.discourse-cdn.com/v4/letter/c/e0b2c6/32.png) [@cooldude88](https://forum.kirupa.com/u/cooldude88)
#### Post date: [June 17, 2008, 11:32pm UTC](https://forum.kirupa.com/t/neat-mouse-follower/263649/1 "2008-06-17T23:32:27Z")

</div>

hey there i just finished this mouse following code that basically simulates a swarm of flies just make a small very small dot or fly either way name it bug\_mc and put the code on it:

```auto
 
onClipEvent(load){
 _x = 0;
 _y = 0;
 speed = 5;
}
onClipEvent(enterFrame){
 if(this._name =='bug_mc'){
  _alpha = 0;
 }
 else{_alpha=100}
 endX = _root._xmouse-25;
 endY = _root._ymouse-25;
 _x +=(endX-_x)/speed;
 _y +=(endY-_y)/speed;
 function rand(){
  randnum = Math.round(random(20));
  randnum2 = Math.round(random(20));
  return(randnum,randnum2);
 }
 rand();
 end2 = randnum;
 end3 = randnum2;
 _x+= end2;
 _y+= end3;
}
 

```

and put this on your frame:

```auto
 
i = 0;
onEnterFrame = function(){
 if(i<=50){
  i++;
  _root.bug_mc.duplicateMovieClip('bug'+i,i);
 }
}

```

if anyone needs any clarification or just wants to comment post away.:party:

---

<div class="post-metadata">

### Author: ![Digitalosophy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/digitalosophy/32/1114_2.png) [@Digitalosophy](https://forum.kirupa.com/u/Digitalosophy)
#### Post date: [June 18, 2008, 12:54am UTC](https://forum.kirupa.com/t/neat-mouse-follower/263649/2 "2008-06-18T00:54:26Z")

</div>

Moving this here, thanks for sharing 🙂

---

<div class="post-metadata">

### Author: ![mrgulabull](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@mrgulabull](https://forum.kirupa.com/u/mrgulabull)
#### Post date: [June 23, 2008, 11:19pm UTC](https://forum.kirupa.com/t/neat-mouse-follower/263649/3 "2008-06-23T23:19:57Z")

</div>

If you linked to an example you would likely get more feedback. Just friendly advice. 🙂

---

<div class="post-metadata">

### Author: ![Syous](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@Syous](https://forum.kirupa.com/u/Syous)
#### Post date: [June 24, 2008, 4:10am UTC](https://forum.kirupa.com/t/neat-mouse-follower/263649/4 "2008-06-24T04:10:55Z")

</div>

I keep reading Meat Mouse Rollover instead of Neat.

---

<div class="post-metadata">

### Author: ![snickelfritz](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@snickelfritz](https://forum.kirupa.com/u/snickelfritz)
#### Post date: [June 24, 2008, 5:13am UTC](https://forum.kirupa.com/t/neat-mouse-follower/263649/5 "2008-06-24T05:13:12Z")

</div>

Mouse Meat rollover.  
Disneyland sells 'em for lunch.
