PDA

View Full Version : Mouse cursor



geedogg
July 27th, 2003, 12:56 PM
Hello, i just got a q for a site im making.

I know that u can sitch the mouse cursor with what ever u want i flash, but is it possible to have f.eks: a man insead of the mouse cursor, then when u roll over diffrent areas, the image switches to something else? (perhaps a tomato;) And when u roll out, it sitches back to the man.

:D thanks

geedogg
July 27th, 2003, 12:57 PM
i forgott to say that:)

Scootman
July 27th, 2003, 08:00 PM
ya ok make a movie clip... in frame 1 put what you want to follow the mouse... in frame 2 put what you want the mouse to change to, and put stop actions on both frames... give the mc an instance name of "mouse"... in the actions for the mc put



onClipEvent(enterFrame)
{
Mouse.hide();
_x = _root._xmouse + (_width/2);
_y = _root._ymouse + (_height/2);
}


it moves it to the mouse position, but since it will center it on the mouse i moved it half the width and half the height over and down so the top left corner of the mc will be the tip of the mouse... if you want it centered then take out the + width/2 and +height /2 .... ok so you got that part and it should be following the mouse.... now in your button put the code



on(rollOver)
{
_root.mouse.gotoAndStop(2);
}
on(rollOut)
{
_root.mouse.gotoAndStop(1);
}

and that should do it...

hope this helps

Scootman
July 27th, 2003, 08:03 PM
there is also

http://www.kirupa.com/developer/flash5/globalmousecursor.htm

and

http://www.kirupa.com/developer/flash5/follow.htm

(but i like my way better :))

geedogg
July 27th, 2003, 08:04 PM
Thanks man!!!!!! :D