New example
Here's how it works, this picture could also help you.
<img src="http://dl.dropbox.com/u/10457408/Construct/ENG_FORUM/C2HowDoI/MovementBehavior/pic.png" border="0">
The sprite has 4 animation frames for 4 possible directions. A frame is chosen on where you click the mouse and the position of the sprite. It's divided into 4 sectors.
frame #0 has sector 315? up to 360? and from 0? to 45?
#1 = 45? - 135?
#2 = 135? - 225?
#3 = 225? - 315?
On the bottom part of the picture - the angle between the click of the mouse and the sprite is about 110?, so the code selects frame 1 (arrow is pointing up).