# MouseTrail Question

**URL:** <https://forum.kirupa.com/t/mousetrail-question/183168>\
**Category:** Uncategorized\
**Created:** [March 24, 2006, 10:38am UTC](https://forum.kirupa.com/t/mousetrail-question/183168 "2006-03-24T10:38:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elementss](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/elementss/32/1698_2.png) [@Elementss](https://forum.kirupa.com/u/Elementss)\
**Post date:** [March 24, 2006, 10:38am UTC](https://forum.kirupa.com/t/mousetrail-question/183168/1 "2006-03-24T10:38:32Z")

</div>

[http://www.kirupa.com/developer/mx/mousetrailer.htm](http://www.kirupa.com/developer/mx/mousetrailer.htm)  
in this tutorial there is an explanation how you can  
make a “realy nice mouse trail”…

how do i turn if off? i want it only on one frame…(-:

Thanks in advance  
Stas

---

<div class="post-metadata">

**Author:** ![Macaroni\_Ted](https://avatars.discourse-cdn.com/v4/letter/m/df788c/32.png) [@Macaroni\_Ted](https://forum.kirupa.com/u/Macaroni_Ted)\
**Post date:** [March 24, 2006, 10:50am UTC](https://forum.kirupa.com/t/mousetrail-question/183168/2 "2006-03-24T10:50:48Z")

</div>

on the frame u want to “turn it off” u can put this code on to remove it.

for (L=0; L\<letters.length; L++) {  
removeMovieClip(\_root[letters[L]])  
}

---

<div class="post-metadata">

**Author:** ![Elementss](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/elementss/32/1698_2.png) [@Elementss](https://forum.kirupa.com/u/Elementss)\
**Post date:** [March 24, 2006, 1:43pm UTC](https://forum.kirupa.com/t/mousetrail-question/183168/3 "2006-03-24T13:43:46Z")

</div>

👁 it does not work…

one more question…

can i change the color of the trail TXT ? how do i do it ?

---

<div class="post-metadata">

**Author:** ![Macaroni\_Ted](https://avatars.discourse-cdn.com/v4/letter/m/df788c/32.png) [@Macaroni\_Ted](https://forum.kirupa.com/u/Macaroni_Ted)\
**Post date:** [March 24, 2006, 2:28pm UTC](https://forum.kirupa.com/t/mousetrail-question/183168/4 "2006-03-24T14:28:55Z")

</div>

it should work it just depends where u put it and if u changed anything to the original code…if so u’ll have to change the code a posted accordingly.  
i just tested it out using the code from the original tutorial.

[AS]//–Type in all the letters–  
stop()  
Text = “kirupa”;  
letters = Text.split("");  
//–The text appearance–  
letterformat = new TextFormat();  
letterformat.font = “Verdana”;  
letterformat.align = “center”;  
letterformat.size = “10”;  
//–Custom values–  
spacing = 12;  
speed = 3;  
//–Creating the text–  
for (L=0; L\<letters.length; L++) {  
\_root.createEmptyMovieClip(letters[L], L);  
\_root[letters[L]].createTextField(letters[L]+“t”, L, L\*spacing, 10, 20, 20);  
with (\_root[letters[L]][letters[L]+“t”]) {  
text = letters[L];  
setTextFormat(letterformat);  
selectable = false;  
}  
//–Making it move–  
if (L\>0) {  
\_root[letters[L]].id = L;  
\_root[letters[L]].onEnterFrame = function() {  
this.\_x += (\_root[letters[this.id-1]].\_x-this.lastX)/speed;  
this.\_y += (\_root[letters[this.id-1]].\_y-this.lastY)/speed;  
this.lastX = this.\_x;  
this.lastY = this.\_y;  
};  
} else {  
\_root[letters[L]].onEnterFrame = function() {  
this.\_x += (\_root.\_xmouse-this.lastX+10)/speed;  
this.\_y += (\_root.\_ymouse-this.lastY)/speed;  
this.lastX = this.\_x;  
this.lastY = this.\_y;  
};  
}  
}  
\_root.onMouseDown=function(){  
for (L=0; L\<letters.length; L++) {  
removeMovieClip(\_root[letters[L]])  
}  
}[/AS]

i just added the code for an example to the on mouse down function.so when you press the mouse button it will remove the text!

---

<div class="post-metadata">

**Author:** ![Macaroni\_Ted](https://avatars.discourse-cdn.com/v4/letter/m/df788c/32.png) [@Macaroni\_Ted](https://forum.kirupa.com/u/Macaroni_Ted)\
**Post date:** [March 24, 2006, 2:34pm UTC](https://forum.kirupa.com/t/mousetrail-question/183168/5 "2006-03-24T14:34:15Z")

</div>

as for the colour.

add this.

ActionScript Code:  
[FONT=Courier New][LEFT]letterformat.[COLOR=#0000ff]color[/COLOR]=[COLOR=#ff0000]“0xEC0000”[/COLOR]  
[/LEFT]  
[/FONT]

to below the other letterformat’s ( this will give u a red text).

---

<div class="post-metadata">

**Author:** ![Elementss](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/elementss/32/1698_2.png) [@Elementss](https://forum.kirupa.com/u/Elementss)\
**Post date:** [March 25, 2006, 7:35am UTC](https://forum.kirupa.com/t/mousetrail-question/183168/6 "2006-03-25T07:35:23Z")

</div>

THANKS 🙂  
You have been a Great help.

Stas
