Mouse Follower with Text Rotation
| Category | : Flash | Views | : 36620 | ||
| Version | : 8 | Rating | : | ||
| Type | : Text | Source File | : mouse-follower-with-text-rotation.zip | ||
| Result | : See the result | ||||

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