Our Flash tutorials provide you with step-by-step instructions on how to create beautiful Flash animations and integrate them into your website.  Home Flash & Swish Flash Tutorials Object Sliding to Cursor with Easing Effect

Object Sliding to Cursor with Easing Effect


Preparations:

Create a new flash file (ActionScript 2.0) and save it as test.fla in this case.

image 1

Step 1:

Draw a circle object on the Stage.

image 2

Step 2:

Convert the object into a Symbol with instance name my_mc.

image 3

Step 3:

Create a layer on top of the object layer and name it as actions.

image 4

Step 4:

Right-click on the frame and select Actions to open up the Actions panel.

Object Sliding to Cursor with Easing Effect

Step 5:

Insert these codes inside the Actions panel.

That's all!

speed = 8;
my_mc.onEnterFrame = function(){
cursorX = _root._xmouse;
cursorY = _root._ymouse;
this._x += (cursorX-this._x)/speed;
this._y += (cursorY-this._y)/speed;
}



Author's URL: 10Steps.SG
Final results of our readers
New!
Passed through all the steps? Share your result!
Your result will be premoderated.
Please make sure you choose the right image.
 
 



Captcha

*Required fileds
Our Flash tutorials provide you with step-by-step instructions on how to create beautiful Flash animations and integrate them into your website. More Flash Tutorials: Featured Materials | Fresh Materials | More Flash Tutorials at FlashPerfection.com

Reader's comments
comments eyed January 19, 2011 says:
what is this supposed to do
Reply
Add comments to "Object Sliding to Cursor with Easing Effect"

Captcha