Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

flash as2 tut - how to make eyes follow your cursor

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
4,022
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Dec 15, 2009

heres the code:

onClipEvent (enterFrame) {
myRadians = Math.atan2(_root._ymouse-this._y, _root._xmouse-this._x);
myDegrees = Math.round((myRadians*180/Math.PI));
_root.yChange = Math.round(_root._ymouse-this._y);
_root.xChange = Math.round(_root._xmouse-this._x);
_root.yMove = Math.round(_root.yChange/20);
_root.xMove = Math.round(_root.xChange/20);
this._rotation = myDegrees+90;
}




hope you like this tutorial, there are more on my channel. iff you want a tutorial made especially for you then just ask and i'll see what i can do :)

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (pivotepics)

  • Awesome!!! Thanks for these tutorials!

  • ur welcome... do u want anything made specially 4 u? jst ask coz i'm really bored at the moment

see all

All Comments (16)

Sign In or Sign Up now to post a comment!
  • @pivotepics How do I make something Follow something else? I'm making a movie and I want my screen to follow a bomb. How do I do that?

  • Ty! I finaly can make a mouse following head for a game.

  • mmm it sayes to me syntax error, expecting semicolon on line one !!!!!

    whats that lol ?

  • the code you put has a mistake on the 2nd last line. It should be

    'this._rotation=myDegrees-90'

  • how do you make a different image your cursor like a smiley face or something?

  • sorry, what do you mean by the small circle on top of the big circle, I think I got taht bit wrong, mine dosen't work..... please help!

  • is this ActionScript 2?

  • @pivotepics how did you come up with this script :D you must be very smart very cool !

  • @CeenerStudios did you finish the game

  • This is the exact thing I needed for this game I'm making where an eyeball follows your cursor and you get through a maze and defend yourself by shooting lasers out of the pupil! It's a weird game but I'll send a link when its done... if I remember.

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more