This, step by step lesson, will show you how to create that every letters follow the mouse using the action script code.
Example: Step 1Create a new flash document and set your Flash movie's frame rate to 28 and click ok.
Step 2Go now to the Action Script Panel, and enter this code inside the actions panel:
Text = "FlashVault.net";
letters = Text.split("");
// This action script code shows text for this animation
letterformat = new TextFormat();
letterformat.font = "Trebuchet MS";
letterformat.align = "center";
letterformat.size = "14";
letterformat.color = 0xffffff;
letterformat.bold = true;
// This code shows a new TextFormat object, size, type, color of font and the last line just creates bold font.
spacing = 6;
speed = 4;
// This code shows size of the area between the letters and speed.
for (var LTR = 0; 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;
};
}
}
// This action script code creates a new movieclip on the timeline and textfield inside the new movieclip.
Have a nice day!
Download source file (.fla)