Requires some basic Math.
Example here
http://bretlanius.com/flash/eyesfollow.html