# Simple question concerning mouse trailer

**URL:** https://forum.kirupa.com/t/simple-question-concerning-mouse-trailer/95027
**Category:** Uncategorized
**Created:** [November 19, 2003, 5:39pm UTC](https://forum.kirupa.com/t/simple-question-concerning-mouse-trailer/95027 "2003-11-19T17:39:28Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![derekd](https://avatars.discourse-cdn.com/v4/letter/d/51bf81/32.png) [@derekd](https://forum.kirupa.com/u/derekd)
#### Post date: [November 19, 2003, 5:39pm UTC](https://forum.kirupa.com/t/simple-question-concerning-mouse-trailer/95027/1 "2003-11-19T17:39:28Z")

</div>

Hello. I am playing around with the Kirupa mouse trailer tutorial, and I am trying to make it so that at different points along a M.C. different pieces of text start following the mouse…a button plays a specific part of the m.c. in which the “trailer code” (pasted below) is, when the user clicks a different button, the playhead goes to a different part of the m.c. that has the same “trailer code” within it, but with different text…Everything is working except when you click the buttons in reverse order a some of the letters from one text are attached the other piece of text. I think I need to clear a variable or something, but am unsure. I know this sounds confusing, but if anyone could help I would appreciate it.  
The piece of code is:  
delete (Text);

Text = “first text”;  
letters = Text.split("");  
letterformat = new TextFormat();  
letterformat.font = “Papyrus”;  
letterformat.align = “center”;  
letterformat.size = “8”;  
spacing = 5;  
speed = 3;  
for (var LTR = 0; LTR\<letters.length; LTR++) {  
mc = \_root.createEmptyMovieClip(LTR+“l”, LTR);  
mc.createTextField(letters[LTR]+“x”, LTR, LTR\*spacing, 10, 20, 20);  
with (mc[letters[LTR]+“x”]) {  
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;  
};  
}  
}
