Mousetrailer?

Could someone tell me how to edit the font color in this code and tell me what I’m doing wrong with regards to getting more than the word “Kirupa” to display in my movie? I’m using flash mx 6.0 and adding more than the word “Kirupa” gives me an error in the movie saying that there is a missing “with” handler (yup, yup, yup…I’m a newbie at this…hehehe).

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;
};
}
}

if the .fla is needed, please ask and I’ll post it here…

BTW: “Kirupa (really does) has the best site on the net!!!”

Add this to your code:[AS]letterformat.color = 0xFFFFFF;[/AS]

Thank you Wizard…I see what I did wrong here…

Hey there Poetic Soul,
in your code, the text seems to take ages to get where it is supposed to go,
here is a much better one (simply changed values in yours though!)

Text = “WELCOME!!!”;
letters = Text.split("");
letterformat = new TextFormat();
letterformat.font = “Verdana”;
letterformat.align = “center”;
letterformat.size = “10”;
spacing = 5;
speed = 1;
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+10)/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;
};
}
}

Ben (flashy22)

original message: “Hey there Poetic Soul,
in your code, the text seems to take ages to get where it is supposed to go,
here is a much better one (simply changed values in yours though!)”

Ok, Flashy…Thanx so much but I’m not sure I understand what you mean about the text. It seems to work fine on my terminal(but I do see what you mean about the speed factor…you changed the speed to 1 I think). The problem I’m having with the code I posted is that I can’t get it to take any other text but “Kirupa” nor can I get it to take more than one word. When I enter other text, it deactivates the script and I get the “with” handler error. I’m so new to this that I’m unsure how to get it to do this…I’ve used the code as outlined in the final .fla that is posted but to no avail. I’m not able to add my .fla here to see if someone can tell me what kind of boner I’ve pulled but the only thing I did differently than the script called for was to load it into frame one of the second scene instead of the first scene(I want it to run on the main site and not the preloader)…the change color text handler that was previously posted in this thread worked great…

P.S. Syko’s link is dead and I can’t try there…

Ok, now I just have to say that Wizard and Flashy are great guys…their help resolved my problems here…thanx to you both! Whatever the dif was with your script Flashy, it fixed my gremlin chasing thingy there…hehehe

Outstanding guys…thanx again!!!

If you guys would like to see the site I’ve been working on, I’d appreciate any advice you have to offer…

:thumb:

Thanks but I think most people could’ve answered your question regarding the color change… still, you’re welcome. :}