• 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 Dragging

Category : Flash Views : 15214
Version : 8 Rating : 
3.1/5 (35 votes)
  • Currently 3.14/5
  • 1
  • 2
  • 3
  • 4
  • 5
Type : Text Source File: mouse-dragging.zip
Result: See the result


Previous | 1 | 2 | Next

To do that, double click the frame rate and set it to 30.
Free Flash Tutorials, Actionscript, Navigation, Mouse Dragging

Free Flash Tutorials, Actionscript, Navigation, Mouse Dragging

The Movie Clips should be moving more smoothly now.

Code Explanation

onClipEvent(load) { xSpeed = 0 ySpeed = 0
Two variable for the starting speed on the _x and _y coordinate.

Speed = 40
Speed used for an easing effect, the bigger it is the slower the Movie Clip will move and vise versa.

Stop = 1.13
Variable used to slow the Movie Clip down so it stops in the location of the mouse.

} onClipEvent(enterFrame) { _x += xSpeed _y += ySpeed
Move the Movie Clip.

xSpeed +=(_root._xmouse - _x) / Speed ySpeed +=(_root._ymouse - _y) / Speed
Set new speeds using the distance between the current location of the Movie Clip and the position of the mouse divided by the "Speed" variable.

xSpeed /= Stop ySpeed /= Stop }
These lines decrease both speeds until it gets in the mouse position.

That's all folks! See you in next tutorial!


del.icio.us digg it Reddit Stumble Upon Technorati

Previous | 1 | 2 | Next
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.