Image panning question

I had tried the image panning tutorial and i have some question with it bcoz i m begginer of AS. Can anyone clear d question marks in my mind? First below is the code and explaination for it. The red colour words are my questions.
[COLOR=blue][COLOR=gray]/*The below section of code registers an onMouseMove event handler. Whenever the mouse moves, any code contained within the this.onMouseMove function will be executed. The code that is executed is the function call constrainedMove(bg_mc, 4, 1); constrainedMove(target, speed, dir)
/[/COLOR]
this.onMouseMove = function() {
constrainedMove(bg_mc, 4, 1);
}; [/COLOR]
[COLOR=blue][COLOR=gray]/
Declaring a new function called constrainedMove. It takes in three arguments - target, speed, and dir. Notice that I define their types as MovieClip, Number, and Number.
*/[/COLOR]
function constrainedMove(target:MovieClip, speed:Number, dir:Number) {

[COLOR=gray] /*The mousePercent variable stores a fraction of your mouse’s X position with regards to your total stage width. This number varies \ between 0 and 1, and as you will see later, it helps dampen or speed up how fast your image scrolls to its boundary.
*/[/COLOR]
var mousePercent:Number = _xmouse/Stage.width;

[COLOR=gray] /*The mSpeed variable either stores the value stored by your mousePercent variable or it reverses the value in your mousePercent variable. Depending on what value you pass in for the dir variable, your mousePercent value will be either mousePercent or 1 - mousePercent.
What this essentially does it reverses the movement of the image scroll based on your mouse movement. For example, when the dir value is 1, your image pans in the same direction as your mouse movement. If the dir value is anything besides 1, then the mouse
movement and the image panning work in opposite directions.
*/[/COLOR]
var mSpeed:Number;
if (dir == 1) {
mSpeed = 1-mousePercent;
} else {
mSpeed = mousePercent;
}

[COLOR=gray] /*The destX variable stores the X position of our image. This line of code is designed to ensure that no matter where the mouse is, as determined by the mousePercent variable stored in mSpeed, that your image will not go beyond either the left-most or right-most
boundaries. One way you can think about this is that, mSpeed is either (1 - mousePercent) or mousePercent. Either way, mousePercent is _xmouse/Stage.width. When you expand this out, for example when dir = 1, your destX variable can be simplified as:
-(_xmouse * (target._width - Stage.width) / Stage.width)
As your mouse position moves, your value for destX changes. What this does, as you will see shortly, is that it sets the final destination for where your image needs to scroll. When you are panning, you would have noticed the image movement is not immediately responsive to your mouse movement. There is a gradual acceleration and deceleration as the image moves to its destination. The destination is what the above destX value finds for you.
*/ [/COLOR][/COLOR]
[COLOR=red]Why target._width - Stage.width? Cant target._width just multiply with mSpeed?[/COLOR]
[COLOR=blue] target.destX = Math.round(-((target._width-Stage.width)*mSpeed));

[COLOR=gray] /*If your image position, target._x, is less than or greater than your destX variable, then you need to move in the appropriate direction to make sure that the difference between where you are and where you should be as specified by the destX variable is
reduced to zero. In other words, your goal is to have both your current position and
the position stored by destX to be the same so that you end the enterFrame by reaching target._x == target.destX.
/[/COLOR]
target.onEnterFrame = function() {
if (target._x == target.destX) { [/COLOR]
[COLOR=blue]
[COLOR=red]sorry, i know is a dumb question, is the code blow means stop running d coding in frame?[/COLOR] [/COLOR]
[COLOR=blue] delete target.onEnterFrame;
} else {
target._x += Math.ceil((target.destX-target._x)
(speed/100));
}
};
} [/COLOR]
[COLOR=#0000ff][/COLOR]
[COLOR=#0000ff][/COLOR]
[COLOR=black]And last question. can this image panning only when d mouse pointer is moving inside then image itself? The image from tutorial is panning when ur mouse pointer is at anywhere in d stage. Let say we make d stage size bigger than the image and we wan to make d image only panning when d mouse pointer is moving in image area. Anyone know how to do it? Plz let me know if you know. Thank you.[/COLOR]