# Mouse trail NEED HELP!

**URL:** https://forum.kirupa.com/t/mouse-trail-need-help/153327
**Category:** flash
**Created:** [June 30, 2005, 6:00pm UTC](https://forum.kirupa.com/t/mouse-trail-need-help/153327 "2005-06-30T18:00:59Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ibenschop](https://avatars.discourse-cdn.com/v4/letter/i/c57346/32.png) [@ibenschop](https://forum.kirupa.com/u/ibenschop)
#### Post date: [June 30, 2005, 6:00pm UTC](https://forum.kirupa.com/t/mouse-trail-need-help/153327/1 "2005-06-30T18:00:59Z")

</div>

Hi people,

I have a mouse trail.  
I got this script from flashkit:

i=0  
onMouseMove = function () {  
var cur\_x = \_xmouse;  
var cur\_y = \_ymouse;  
var limit = 3;  
var min = 10;  
var max = 60;  
var alfa = 160;  
var delta\_x = old\_x-cur\_x;  
var delta\_y = old\_y-cur\_y;  
var dist = Math.sqrt(delta\_x_delta\_x+delta\_y_delta\_y);  
old\_x = cur\_x;  
old\_y = cur\_y;  
if (dist\>limit) {  
i++;  
attachMovie(“stars”, “stars”+i,-510+i);  
with (this[“stars”+i]) {  
var ran = Math.random()\*max+min;  
var ran2 = Math.random()\*alfa-alfa/2;  
\_rotation = ran2;  
\_xscale = \_yscale=ran;  
\_x = \_parent.\_xmouse;  
\_y = \_parent.\_ymouse;  
}  
}  
};

I’m not a pretty good actionscripter.  
I want the mousetrail to be only in action in a certain part of my screen.  
Now it plays over the whole screen.

Anyone help me with this?

Thanks
