.
Cool mouse follow animation
In this Flash tutorial you will see how to make an object follow your mouse cursor, this is a great feature for games, animations or any other place, (but please don't do custom cursor on a website, not many web designs can pull that off without looking like an amature site).
I have added a delay on the object that follows the mouse, to make it a bit more interesting, because honestly its fairly easy and only requrers a few lines of code.
First you have to make or import an object / image, then convert it to a movie clip by right click and choose convert to symbol. As you can see in the image below I made a flower of some kind, you can do as I did, go into the movie clip and animate it if you feel like it, but thats another tutorial.

Now give your new movie clip an instance name we can refere to in our action script coding, I named mine flower, as you can see from the image below.

Now hit F9 and add the following code.
_root.onEnterFrame = function(){
X = _root._xmouse - 10;
Y = _root._ymouse - 10;
flower._x = flower._x + (X - flower._x)/10
flower._y = flower._y + (Y - flower._y)/10
}
onEnterFrame is one of the most common event handlers, everything you put in the onEnterFrame will be updated all the time, so therefore if you say something should have the same position as the mouse it will update as the mouse moves, as it is shown in the code above.
What we then did was to add some delay to the flower. These two lines control the x and y axis and the speed our flower should have going closer to the mouse cursor.
flower._x = flower._x + (X - flower._x)/10 flower._y = flower._y + (Y - flower._y)/10
Admin Bob says: 2008-10-13
thijs says: 2008-10-13
eee says: 2008-09-19
Tyler says: 2008-08-06
piprazer says: 2008-07-08
Tony says: 2008-03-13
Rio says: 2008-03-12
Admin Bob says: 2008-02-23
lfb says: 2008-02-22
jaythefray says: 2008-02-22
jaythefray says: 2008-02-22
jaythefray says: 2008-02-22
lfb says: 2008-02-22
Admin Bob says: 2008-02-22
jaythefray says: 2008-02-22
tyler says: 2008-01-26
Admin bob says: 2008-01-27
Admin bob says: 2008-01-20
josh says: 2008-01-17
lady_bird says: 2008-01-16
Dan says: 2008-01-05
Jenifer Lopez says: 2007-12-24
Mark Danforth says: 2007-12-24
Gillian Wentworth says: 2007-12-24
Libby Tayla says: 2007-12-24
cabs says: 2007-12-19
Chris Andrews says: 2007-12-19
Admin bob says: 2007-12-20
Admin Bob says: 2007-12-25

