Author: Chumpitas
Date released: 02/16/2007
Name: Mouse follower

Easiest way to create object who will follow your mouse in Macromedia Flash 8.
 

[Flash] Tutorial #3 - Mouse follower

 
 

Software: Macromedia Flash 8
Time: 1 minutes

Follow me...


1. Open new document (any size, I'll set 500*500)

2. Draw circle just with stroke, without fill color


3. Convert circle to movie clip and add him a istance name: circle



4. Add new layer

5. On new layer, on first frame, write this code in actionscript window:

code



_root.onEnterFrame = function(){
positionX = _root._xmouse - 55;
positionY = _root._ymouse - 50;
circle._x = circle._x + (positionX - circle._x)/15
circle._y = circle._y + (positionY - circle._y)/15
}

6. That's all, can you believe? Test your movie (Ctrl + Enter)

7. Everything else is your imagination.

 

 
Untitled Document

Links:


Donate, and help us to exist.

8. Download final .fla file if you want - Flash tutorial #3


9. If you have some questions about this tutorial, please contact me: chumpitas@gmail.com