I like this method:
On Left Mouse Button Down
--> Set Angle of Motion = round(angle(object.X, object.Y, mouse.X, mouse.Y) / 90) * 90
If you wanted it 4 way, it'd be 90 (90 * 4 = 360). If you wanted it 8 way, then you'd change 90 to 45 (45 * 8 = 360). It will go to whatever the closest angle is. Then I like to do:
If Moving
Compare Object.8Direction.Angle of Motion = 0
--> Set Animation Walk Right
Compare Object.8Direction.Angle of Motion = 90
--> Set Animation Walk Down
Compare Object.8Direction.Angle of Motion = abs(180)
--> Set Animation Walk Left
Compare Object.8Direction.Angle of Motion = -90
--> Set Animation Walk Up
There are more ways to do it, but I like that method well enough.