I’m creating a small multiplayer game and I am trying to find how to get the direction the mouse is compared to where the character is…
For example, if the Character is at Point A, I would like the direction the character is facing to change so it is facing the direction at where the mouse is.
I’ve created the direction movieclips for my character by following as a guide:

I’ve tried numerous online code/suggestions/howtos and none of them work for me.
You can use a function like this to determine the degree angle:
Using this function,
pointis the point of the mouse in comparison tocenterwhich is the registration point or center of your character.So, this can be called such as:
I would recommend using Flash native coordinate system – values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation.
Per translating these to a cardinal direction system, there’s probably elegant algorithms such as using the dot product; however, you could brute force: