Ill try to explain this
You have conditions and you have actions
It works like: If (condition), then (action)
In your case i would do the following
Attach an empty sprite to the position of the character
Set action that Sets angle toward Mouse.X/Mouse.Y
Now you have the emty sprite rotating toward the mouse
If the 8 directions of the character are 8 different animations, then set the following event:
IF: System, Every tick /THEN: "Character sprite" Set Animation
and in Animation tipe "round(EmtySprite.Angle/45)"
that makes the angle from 0 to 44 = 0, 45 to 89 = 1, 90 to 134 = 2 and so on.
So now when the angle is within 0 - 44 you get 0, which is animation 0
Hope you understand it
BTW i dont know if thats the best way but i'm just trying to help.