# Mouse trail effect for an object

**URL:** https://forum.kirupa.com/t/mouse-trail-effect-for-an-object/33829
**Category:** Uncategorized
**Created:** [October 24, 2003, 12:08am UTC](https://forum.kirupa.com/t/mouse-trail-effect-for-an-object/33829 "2003-10-24T00:08:11Z")
**Posts on this page:** 6
**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/33829/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++;  
}

---

<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: [October 24, 2003, 12:13am UTC](https://forum.kirupa.com/t/mouse-trail-effect-for-an-object/33829/2 "2003-10-24T00:13:59Z")

</div>

instead of \_root.\_xmouse and \_root.\_ymouse, write in the x,y coordinates of your object, like: myObject.\_x, myObject.\_y

---

<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: [October 24, 2003, 12:18am UTC](https://forum.kirupa.com/t/mouse-trail-effect-for-an-object/33829/3 "2003-10-24T00:18:10Z")

</div>

Wow! Thanks a lot for you for your help! I really appreciate it!

Will this work if the object is on a motion guide…thanks!

---

<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: [October 24, 2003, 12:24am UTC](https://forum.kirupa.com/t/mouse-trail-effect-for-an-object/33829/4 "2003-10-24T00:24:21Z")

</div>

eh? What object?

---

<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: [October 24, 2003, 3:54am UTC](https://forum.kirupa.com/t/mouse-trail-effect-for-an-object/33829/5 "2003-10-24T03:54:12Z")

</div>

you were saying to write in “the x,y coordinates of the object” - i was wondering if this will work if the object or symbol is on a motion guide…thank so much for you help!

---

<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: [October 24, 2003, 4:39am UTC](https://forum.kirupa.com/t/mouse-trail-effect-for-an-object/33829/6 "2003-10-24T04:39:53Z")

</div>

well, those two things kind of conflict eachother. If it’s on a motion guide, then the guide is wanting to move it. If you use actionscript to start writing \_x and \_y corrdinates to it, then those will want to move it. All I can say is try it and find out!

You’re welcome for the help.
