• Home
  • Free Tutorials
  • Free Video Tutorials

Adobe Photoshop
Autodesk 3ds Max
CSS
Flash
Help Center Live
iPhone
Joomla
Make Money Online!
Mambo
mIRC
Outlook Express
SEO / SEM
Simple Machine Forum
Target Explorer

Mouse Follower

Category : Flash Views : 24307
Version : 8 Rating : 
2.8/5 (45 votes)
  • Currently 2.80/5
  • 1
  • 2
  • 3
  • 4
  • 5
Type : Text Source File: mouse-follower.zip
Result: See the result


The mouse follower is a simple effect that can be used in almost anything, its one movie clip that will follow your mouse around.

The first thing to do is create the movie clip that will be following your mouse.
When you create it make sure it is positioned like this:
Free Flash Tutorials, Navigation, Interactive, Mouse Follower
You can select your drawing and press "Ctrl + 2" then "Ctrl + 5" and Flash will center it automatically.

Now drag your movie clip to the stage, right click it and select Actions.
Paste this code:
onClipEvent (load) { this._x = 0; this._y = 0; var speed = 20; } onClipEvent (enterFrame) { _x += (_xmouse - _x)/speed; _y += (_ymouse - _y)/speed; }
On load we set this Movie Clip position to be equal to the mouse and the speed to 20.
Those speeds work a little different, the bigger they are the slower the Movie Clip is going to move.
When Flash enters the frame we increase the Movie Clip’s position by the distance between the mouse and the Movie Clip, divided by the speed.

The Movie Clip is already moving towards the mouse, but let’s make the Movie Clip rotate now.
onClipEvent (load) { this._x = 0; this._y = 0; var speed = 20; var rotSpeed = 5; } onClipEvent (enterFrame) { _x += (_xmouse - this._x ) / speed; _y += (_ymouse – this._y) / speed; _rotation += (((_xmouse - this._x) / rotSpeed) + ((endY - this._y) / rotSpeed)) / 2; }
This code will make the Movie Clip rotate depending on the direction and the speed he is "walking".
And just like the other speed, the bigger rotSpeed is the slower the Movie Clip will rotate.

I hope you liked this special effect and start using it on your movies.

del.icio.us digg it Reddit Stumble Upon Technorati
How to Video Tutorials on software by Helpvids.com

Video tutorial: Forex trading



Sponsors



Advertisement









Studio | Advertisement | About Webzo | Contact Webzo | Terms of Use | Free Video Tutorials by Helpivds

Copyright © 2007 NR Concepts Ltd. All rights reserved.