How to make image to stop?


So i have been looking at the forum and cant find anything that explain me how to do this.

I have an image that the width is like 2x bigger than the stage. I made an actionscript that the image mooves like my mouse moove. so, if i am mooving my mouse to right, the image mooves to right too.

My problem is: i want to make the image stop when i reach her end in one of the sides.

when i moove the mouse and the image mooves too, i want that, when the image reachs her total left or right to stop so i do not have the stage with no image in the background.

Since the image has his ref point in the top left, i made something like this:

**if (_root.image._x > 0){
trace (“you have reach the left maximum of the image”);

** Plz help, need that for school work :slight_smile: