Auto Rotate

I am fairly new to flash and was wondering if someone could help me make a code so that a MC rotates in the direction it just moved. Say I make it go left, it would then rotate from its facing up to pointing left. I am trying to make it do this automaticly. I was thinking of using XPrevious and YPrevious variables to determine the direction it moved. I dont know if AS has a build in function for determining the direction to a point (If it doesn’t, could you help me make one). and then adding 180 to the MC’s current direction: Direction. If you could pass me off to a tut that would be much appreciated also.

Thanks for your help,