# Mouse trail effect for an object

**URL:** https://forum.kirupa.com/t/mouse-trail-effect-for-an-object/92986
**Category:** Uncategorized
**Created:** [October 24, 2003, 12:08am UTC](https://forum.kirupa.com/t/mouse-trail-effect-for-an-object/92986 "2003-10-24T00:08:11Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![angrybot55](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@angrybot55](https://forum.kirupa.com/u/angrybot55)
#### Post date: [October 24, 2003, 12:08am UTC](https://forum.kirupa.com/t/mouse-trail-effect-for-an-object/92986/1 "2003-10-24T00:08:11Z")

</div>

i am trying to create a trail behind an object - like a mouse trailer. i have found many mouse trailer scripts but do not know what to adjust so that it will follow an object/symbol…thanks for you help…here is the script that i was gonna use…

//initialization  
d=1;  
speed=10;  
ssize=10;  
dif=60;

//create sample  
\_root.createEmptyMovieClip(“sample”, 16000);  
with(\_root.sample){  
lineStyle(5, 0x0, 70);  
moveTo(-10, 0);  
lineTo(10, 0);  
moveTo(0, -10);  
lineTo(0, 10);  
}

//hide sample  
\_root.sample.\_visible=0;

//duplicating clips  
\_root.onMouseMove=function(){  
duplicateMovieClip(“sample”, “start”+d, d);  
\_root[“start”+d].\_x=\_root.\_xmouse+random(dif)-dif/2;  
\_root[“start”+d].\_y=\_root.\_ymouse+random(dif)-dif/2;  
\_root[“start”+d].\_width=ssize;  
\_root[“start”+d].\_height=ssize;  
mColor=new Color(\_root[“start”+d]);  
mColor.setTransform({rb:random(256), gb:random(256), bb:random(256)});  
\_root[“start”+d].\_visible=1;  
\_root[“start”+d].onEnterFrame=function(){  
this.\_alpha-=speed;  
if(this.\_alpha\<=0) removeMovieClip(this);  
}  
d++;  
}
