Flash Follow Mouse Tutorial

5 posts Page 1 of 1
Contributors
User avatar
hungryhounduk
VIP - Site Partner
VIP - Site Partner
Posts: 2870
Joined: Mon Jul 27, 2009 11:58 am

Flash Follow Mouse Tutorial
hungryhounduk
Hi All
Here is a Very simple Tutorial on HOW TO MAKE A MOVIE CLIP FOLLOW THE MOUSE

Image

1. Create a new empty Flash Document

2. Add a Picture or anything to the Flash Library then drag it out onto the Flash Stage and convert it too a MOVIE CLIP (Select it and Press F8 ) then in the dialog box that pops up Choose Movie Clip and click OK.

3 Click on the Object on the Stage and Press F9 to open the Actionscript window for the Movie Clip and paste this code in.
Code: Select all
onClipEvent (load) {
	_x = 0;
	_y = 0;
	speed = 8;
}
onClipEvent (enterFrame) {
	endX = _root._xmouse;
	endY = _root._ymouse;
	_x += (endX-_x)/speed;
	_y += (endY-_y)/speed;
}
Then Press CTRL+eNTER TO RUN it

The code above is really self explanatery

i have used the Codenstuff Gif for my Movie clip cooll;

Download the attachment and check it out, where ever you move your Mouse it will follow

Happy Mouse Following wahooo;

Chris
You do not have the required permissions to view the files attached to this post.
Image
User avatar
Usman55
VIP - Site Partner
VIP - Site Partner
Posts: 2821
Joined: Thu Dec 24, 2009 7:52 pm

Re: Flash Follow Mouse Tutorial
Usman55
Hello Hungryhounduk,

In my school's website, there were two eyes that followed my mouse. I wondered how it is done. But now you've scared away my wonders. lol. Can this be done in Visual Basic? Please reply!

Thank you.
Image
User avatar
hungryhounduk
VIP - Site Partner
VIP - Site Partner
Posts: 2870
Joined: Mon Jul 27, 2009 11:58 am

Hi Usmann55
yes i am sure it can be done in VB, in fact i think there was a post somewhere on here that showed you how to do it, but i might be mistaken :)

Chris
Image
Lewis
Coding God
Coding God
Posts: 1564
Joined: Sun Dec 20, 2009 2:12 pm

Re: Flash Follow Mouse Tutorial
Lewis
i think i saw something like eyes follow the mouse i think it was html + js and yes there is a way in vb i will just try and get that for you.
Image
User avatar
rocky4126
VIP - Donator
VIP - Donator
Posts: 258
Joined: Mon Nov 16, 2009 7:39 pm

Re: Flash Follow Mouse Tutorial
rocky4126
simple but good :)

this was one of the first things I did. And lewis, yeah, it will have been HTML + JavaScript.
Image
5 posts Page 1 of 1
Return to “Tutorials”