# Mouse Trail

**URL:** https://forum.kirupa.com/t/mouse-trail/222364
**Category:** Uncategorized
**Created:** [April 12, 2007, 6:38pm UTC](https://forum.kirupa.com/t/mouse-trail/222364 "2007-04-12T18:38:42Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![div](https://avatars.discourse-cdn.com/v4/letter/d/838e76/32.png) [@div](https://forum.kirupa.com/u/div)
#### Post date: [April 12, 2007, 6:38pm UTC](https://forum.kirupa.com/t/mouse-trail/222364/1 "2007-04-12T18:38:42Z")

</div>

I am trying to get the code to work for the mousetrail animation. I wanted to change the color and the word. Somehow, when i play the movie, the initial instance displays the word at first and then reverts back to ‘kirupa’ and the color doesnt change. Can anyone help me with that? PLEASE? I really need it quite urgently, and havent been able to figure it out. TIA!

CODE below:

Text = “Kirupa has the best site on the net!!!”;  
letters = Text.split("");  
letterformat = new TextFormat();  
letterformat.font = “Verdana”;  
letterformat.align = “center”;  
letterformat.size = “10”;  
spacing = 8;  
speed = 3;  
for (var LTR = 0; LTR\<letters.length; LTR++) {  
mc = \_root.createEmptyMovieClip(LTR+“l”, LTR);  
mc.createTextField(letters[LTR]+“t”, LTR, LTR\*spacing, 10, 20, 20);  
with (mc[letters[LTR]+“t”]) {  
text = letters[LTR];  
setTextFormat(letterformat);  
selectable = false;  
}  
if (LTR) {  
mc.prevClip = \_root[(LTR-1)+“l”];  
mc.onEnterFrame = function() {  
this.\_x += (this.prevClip.\_x-this.\_x+5)/speed;  
this.\_y += (this.prevClip.\_y-this.\_y)/speed;  
};  
} else {  
mc.onEnterFrame = function() {  
this.\_x += (\_root.\_xmouse-this.\_x+10)/speed;  
this.\_y += (\_root.\_ymouse-this.\_y)/speed;  
};  
}  
}
