View Full Version : mouse trail tutorial
CtrlZ
February 11th, 2004, 06:21 AM
I have been using the following tutorial on this site and wonder if anyone can let me know how I would remove the effect when the user clicks a button to move to another part of the site?
http://www.kirupa.com/developer/mx/mousetrailer.htm
thanks to all in advance!
blah-de-blah
February 11th, 2004, 06:55 AM
You could use removeMovieClip();, or maybe making it:
on (press) {
Text = ""
}
that should work i think
CtrlZ
February 11th, 2004, 07:04 AM
the section of code for creating the Movieclip is as follows:
for (var LTR = 0; LTR<letters.length; LTR++) {
mc = _root.createEmptyMovieClip(LTR+"l", LTR);
I have been tying to use removeMovieClip(); but am unsure what should go in the brackets since all the movie clips are created using a loop.
Voetsjoeba
February 11th, 2004, 09:40 AM
They were created in a for loop using _root.createEmptyMovieClip(letters[L], L), so to remove them you use the same for loop with removeMovieClip:
for (var i=0; i<letters.length; i++) {
_root[letters[i]].removeMovieClip()
}
That's all. I've attached an example FLA for you.
CtrlZ
February 11th, 2004, 10:16 AM
You're a star!!
Thank you
CtrlZ
February 13th, 2004, 05:44 AM
That worked brilliantly in a completely new movie but not in the one I am working on for some reason, the following mouse trail works in the project I am working on but the button code that Voetsjoeba kindly gave me dosen't
can anyone help with this?
I am sorry I am being such a newbie!!
Text = "kirupa";
letters = Text.split("");
letterformat = new TextFormat();
letterformat.font = "AGaramond";
letterformat.align = "center";
letterformat.size = "24";
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, 32);
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;
};
}
}
Voetsjoeba
February 13th, 2004, 02:09 PM
I see the problem. The sample FLA from the tutorial (the file I modified) uses other names than the the code the tutorials gives. The new code is:
removeEm.onRelease = function() {
for (var i = 0; i<letters.length; i++) {
_root[i+"l"].removeMovieClip();
}
};
Example file:
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.