dragable objects?

How can i create an object which i can drag only in two direction?