• Top Members
    Reps
    Posts
  • 834 Replies
    2585 Replies
  • 716 Replies
    2026 Replies
  • 331 Replies
    1928 Replies

Flash Follow Mouse Tutorial

User avatar
hungryhounduk
VIP - Site Partner
Posts: 2870

Flash Follow Mouse Tutorial

Fri Jan 08, 2010 10:18 pm

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
Posts: 2821

Re: Flash Follow Mouse Tutorial

Fri Apr 23, 2010 1:27 pm

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
Posts: 2870

Re: Flash Follow Mouse Tutorial

Sun Apr 25, 2010 8:05 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

no avatar
Lewis
Coding God
Posts: 1564

Re: Flash Follow Mouse Tutorial

Sat Jun 19, 2010 9:22 pm

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
Posts: 258

Re: Flash Follow Mouse Tutorial

Fri Jan 14, 2011 9:25 pm

simple but good :)

this was one of the first things I did. And lewis, yeah, it will have been HTML + JavaScript.
Image

Post Reply

Return to “Tutorials”