A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Eyes Follow the Mouse?

  1. #1
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976

    Eyes Follow the Mouse?

    Ive just been mucking around with flash lately and while i was muking around i decided to try to do the eyes follow the mouse thing you always see. But while i was trying i work out i wouldnt have a clue how to do it. Would someone please be able to help. I cant work out how to keep the pupels in the eyes. and face the direction of the mouse ??

    Please help

  2. #2
    Senior Member
    Join Date
    Feb 2003
    Location
    right behind you
    Posts
    174
    onClipEvent(enterFrame){
    angle = (Math.atan2(_root._ymouse-_y,_root._xmouse-_x)*180/Math.PI)+90;
    _rotation = angle;
    }
    you can change around the +90 depending on where the pupils are placed. also, i use that code in each individual eye, makes it look more realistic.

  3. #3
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976
    Thanks very much for that. But i think their might be something missing or something because when i place it on the pupil mc or any mc for that i does nothing ?
    I mean it doesnt do nothing it rotates the pupil mc but i also wanted it to move towards the mouse until it reaches the outscirts of the eyeball?

    ThankS in AdvancE

    [h]ooligan
    Last edited by hooligan2001; 04-03-2003 at 09:15 PM.

  4. #4
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976
    Does anyone even come in the Maths Physics Forum ...

  5. #5
    Senior Member
    Join Date
    Feb 2003
    Location
    right behind you
    Posts
    174
    try this.
    Attached Files Attached Files

  6. #6
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976
    thanks mr spock for posting that but when i try to open it it says's unexpected file format which is really weird cause im opening it in mx

  7. #7
    Who needs pants? hooligan2001's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere
    Posts
    1,976
    No need to repost i worked it out Thanks Agian to all of you

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