Mouse Follower with Text Rotation
| Category | : Flash | Views | : 34915 | ||
| Version | : 8 | Rating | : | ||
| Type | : Text | Source File | : mouse-follower-with-text-rotation.zip | ||
| Result | : See the result | ||||
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.