Text Mouse Trails

2 posts Page 1 of 1
Contributors
User avatar
hungryhounduk
VIP - Site Partner
VIP - Site Partner
Posts: 2870
Joined: Mon Jul 27, 2009 11:58 am

Text Mouse Trails
hungryhounduk
Hi All
Here is a Really simple Effect called "Text Mouse Trails" and as you move your Mouse around the text will follow.

Image

1. open a new Flash Document and Copy & Past the code below into the first Frame of the Document ( Click on the First frame and press F9 t o open the Actionscript window ) and thats it :D
Code: Select all
Text = "Codenstuff.com 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 you look at the text in the Code you can change, Speed, Size and what you want the Text to say, just change it all too suit how you want it to look.

Attachment below to show you what its like cooll;

enjoy

Chris
You do not have the required permissions to view the files attached to this post.
Image
Lewis
Coding God
Coding God
Posts: 1564
Joined: Sun Dec 20, 2009 2:12 pm

Re: Text Mouse Trails
Lewis
Yet again, another great tutorial by you! :P
Image
2 posts Page 1 of 1
Return to “Tutorials”