Home | Help Forums | Web Design Tutorials | Free Swishmax Downloads | All Downloads

 

 

Company

Home

Nework Details

Tutorials

SWiSH 2

SWiSHMax

Flash MX

PHP & MySQL

HTML / JScript

Adobe Photoshop

Corel Draw

Gimp

Miscellaneous

Downloads

Templates

Plugins

Fonts

Wallpapers

Free Images

Scripts and Codes

Products

E-Books

SWiSH BB

SWiSH Templates

SWiSH-DB Newsletter
Subscribe to our newsletter : GO
  Partners / Affiliates

   Swish Templates
   SWiSH Climax
   GimpTalk
   Idea Designs
   Sposatoettore
   Try Acai Berry Diet
   Download Free Ringtones
   Swishzone

Manage your site with Flax Article Content Management System
Object followes mouse
Category : Flash | Level : Beginner | Language : English
Ask Question | Read Comments | Post tutorial | Previous | Next

Web www.swish-db.com

hello every1.....this is really simple,
how to make an object follow the mouse in flash with an ease... smile.gif
Open FlashMX.......create and object and convert it to Movie Clip....and giv it an instance name..... "myTrailer_mc"
On the top layer create another layer and name it "actions"....and then go to frame 1 of "actions" and add the following code:-
CODE
myTrailer_mc.onEnterFrame = function (){
with(this){
distX = (_root._xmouse - _x);
distY = (_root._ymouse - _y);
_x += distX*0.2;
_y += distY*0.2;
}
}

you are done...hope this was useful... smile.gif


Gday


All rights reserved - swish-db.com