Hey all… this may seem like a pretty stupid question, so pardon me, but I’m pretty much brand-new to Flash and ActionScript (minus the Tutorials included with it I’ve taken).
Anyways… I know how to make something follow the cursor (e.g. a ball that moves where your cursor does). However, I’m having a lot of trouble figuring out how to do what I need to for an animation, namely make eyes follow a cursor.
Here’s the situation: I need to make a graphic (the eye in the middle of the eyeball) follow the cursor (i.e. look up, look left, look in any number of diagonal directions) depending on where the user moves the cursor. But the eyes, obviously, need to stay put in one static spot and move in a very limited region (the entire white part of the eye, but not beyond it).
Furthermore, the eyes start out staring at the user. How do I additionally make them dart to the edges where they’ll be looking around once the cursor is moved?
Thanks for trying to help me, but alas, I’m afraid I’m too much of a novice to use your advice properly
Should I be using the StartDrag command for this? Because the eye seems to move a set distance from the cursor while following it, instead of rotating to follow the cursor from a fixed point. Argh! I hate being ignorant
Anyways… here’s my .fla file, too, so everyone can scream “NO, YOU BUFFOON!” and save the day for me
well im not too hot on my trig skills considering i havent taken that class… but the first line calculates the rotation with a tangent thingy… ( i learned soh cah toa in geometry last year ) and then it applys the rotation to the pupil of the eye…
also, notice how he moved the center point of the pupil off to the side so it will rotate around the center of the eye… so its rotating around that fixed point