
We will put the text inside a graphic because we need to tween it later and flash doesn't let us directly tween text.
So create a new graphic symbol; it's the same thing as creating a Movie Clip, but select "Graphic" instead of "Movie Clip":
Inside draw a static textbox and write whatever you want.
Now create a new Movie Clip called "textAnimation".
Drag an instance of the text graphic on the first frame, copy this frame and paste it on the frame 2 and 30.
Set the identifier to "Text" for this Movie Clip.
On the first frame of the main timeline paste this code:
//angle for the textAnimation Movie Clip var newAngle = 0; //used just to create new Movie Clips var count = 0; //attach textAnimation Movie Clip attachMovie("Text", "Text" + count, 1000 + count); //set x(y)Pos to the first Text Movie Clip coordinates var xPos = Text0._x; //we will use this variables to move the Movie Clips var yPos = Text0._y;
Now on the text Movie Clip open the actions for the first frame and paste:
//if the mouse is to the right of this Movie Clip if(_root.xPos < (_root._xmouse - 10)) { //increase xPos by 10 _root.xPos += 10; } //if the mouse is to the left else if(_root.xPos > (_root._xmouse + 10)) { //decrease the xPos by 10 _root.xPos -= 10; } //if moved down if(_root.yPos < (_root._ymouse - 10)) { _root.yPos += 10; }
//if moved up else if(_root.yPos > (_root._ymouse + 10)) { _root.yPos -= 10; } //set this Movie Clip's coordinate to the x(y)Pos this._x = _root.xPos; this._y = _root.yPos; //increase the angle by 10 so the Movie Clip rotates _root.newAngle += 10; //set our rotation to the new angle this._rotation = _root.newAngle; //increase the count so we can create a new Movie Clip on the next frame _root.count++;
On this frame we use global variables, so every instance of this Movie Clip will be increasing the global variables x(y)Pos and newAngle. These Movie Clips won't actually rotate or move we will just create new instances using new positions and angles.
On the second frame select the text graphic make some changes.
Select this option on the properties tab:

And change these settings:

This will change the color of the text; you can use any color you want.
On the last frame do the same thing, but select the "Alpha" option instead of "Tint" and set it to 0%.
And make the graphic instance smaller using the Free Transform Tool.
Paste this on the second frame:
//here we attach a new Movie Clip that will have the //new angle and position we set on the previous frame. _root.attachMovie("Text", "Text"+_root.count, 1000+_root.count);
Now on the last frame:
//remove this Movie Clip this.removeMovieClip();
Done. Try not to get over 1 line on your text as it wont look too good.
Code Explanation
var newAngle = 0;
Fixed angle for the Movie Clips, each Movie Clip attached increase this variable by one creating a rotation effect that actually doesn't exist.var count = 0;
Variable used for new Movie Clips.attachMovie("Text", "Text" + count, 1000 + count);
Attach the Movie Clip.var xPos = Text0._x; var yPos = Text0._y;
Variable used to control the attached Movie Clip's positions.The Movie Clips also have a fixed position; the effect of movement is created by attaching new Movie Clips in new positions every frame. To do that we just need to change these two variables.
if(_root.xPos < (_root._xmouse - 10)) { _root.xPos += 10; }
If the mouse if to the right of this Movie Clip increase the xPos variable by 10 so that the next Movie Clip attached is positioned 10px to the right.else if(_root.xPos > (_root._xmouse + 10)) { _root.xPos -= 10; }
Decrease variable to move the next Movie Clip to the left.if(_root.yPos < (_root._ymouse - 10)) { _root.yPos += 10; }
Increase yPos to go down.else if(_root.yPos > (_root._ymouse + 10)) { _root.yPos -= 10; }
Decrease to go up.this._x = _root.xPos; this._y = _root.yPos;
Set this Movie Clip's position using the variable xPos and yPos._root.newAngle += 10;
Increase the global angle variable. The next Movie Clip will also use this variable always adding 10� and creating a rotation effect.this._rotation = _root.newAngle;
Set the Movie Clip's rotation._root.count++;
Increase this variable to create Movie Clips._root.attachMovie("Text", "Text"+_root.count, 1000+_root.count);
Attach a new Movie Clip.this.removeMovieClip();
Remove Movie Clip after it got to the last frame.
discuss this topic to forum
