Help with interactive image pan

Does anyone how to make this effect - http://www.kirupa.com/developer/flash8/interactive_image_pan.htm - pan in all directions, not just left and right?