Image panning help needed

Hello all I went through this page
http://www.kirupa.com/developer/flash8/interactive_image_pan.htm

it was quite helpful but I am failed to resize/ restrict to it within the width of the movieclip rather than the whole stage.

Any help would be much appreciated.

Thank You in advance.