A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: How would i go about...

  1. #1
    Senior Member
    Join Date
    May 2002
    Posts
    140
    How can i make a mouse follower like the one on this site http://www.h69.net ? I can make the thing follow the mouse but how to make it springy :S

    Thanks in advance
    Esherbet

  2. #2
    Senior Member
    Join Date
    Jun 2001
    Location
    Ottawa, Canada
    Posts
    304

    the word you want is...

    inertia...

    actionscripted mouse follow action... do a search here at flashkit or

    http://www.kirupa.com/developer/actionscript/spring.asp

    m

  3. #3
    Senior Member
    Join Date
    May 2002
    Posts
    140
    Thanks!

  4. #4
    Senior Member
    Join Date
    Apr 2001
    Posts
    207

    Smile put this code...

    Place this scripts inside the object to follow the mouse.
    Basically the distance between the mouse and the object
    is diminished.

    frame 1:
    physics0 = 0.25;
    physics1 = 0.5;

    frame 2:
    // nothing in here

    frame 3:
    xspeed = ((_root._xmouse-_x)*physics0)+(xspeed*physics1);
    yspeed = ((_root._ymouse-_y)*physics0)+(yspeed*physics1);

    // add the speed to the current position of the object
    _x += xspeed;
    _y += yspeed;

  5. #5
    Senior Member
    Join Date
    May 2002
    Posts
    140

    Thanks

    Thanks alot for your help , is appreciated

    Esherbet

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center