Well, you could do it by getting the difference in angle from the torso to the mouse and the angle of motion for your player, but that's a lot of math that I wouldn't want to bother with so I'd just do something like this:
Make four detector objects that follow the player, but do not rotate. Next, set up a series of image points for your torso, one in each direction. When the image overlap the detector objects, they tell that object what animation should play when the player moves.
<img src="http://i42.tinypic.com/qracyc.jpg">
Then, when the player presses a movement key, pick the proper detector that matches the key, get the direction that's stored in the private variable, and play that animation.
It's low-tech, but it should do the trick.