Create two instance variable for the object and set them while dragging: prevX and prevY. Set up an event to check before you update the variables.
So something like:
Object Is dragging
1) if object.prevX < object.X then you know the object has moved to the right, etc.
2) set object.prevX to object.X
You have to do the comparison before you update the variables, otherwise prevX and X will be the same.