hi
I have followed the image panning tutorial but my results are not as described in the tutorial. the image does not pan all the way to its left edge and it does pan past its right edge. although I tried to figure out myself why this is so, my AS knowledge is not enough to troubleshoot it.
my stage is 300w x 200h, my image movieclip is 1000w x 200h and is positioned on 0x and 0y on stage with its pivot point at the center. It would be great if someone could point me to my error. here is the code as I have pasted it from the tut into the 1st frame:
this.onMouseMove = function() {
constrainedMove(bg_mc, 4, 1);
};
function constrainedMove(target:MovieClip, speed:Number, dir:Number) {
var mousePercent:Number = _xmouse/Stage.width;
var mSpeed:Number;
if (dir == 1) {
mSpeed = 1-mousePercent;
} else {
mSpeed = mousePercent;
}
target.destX = Math.round(-((target._width-Stage.width)mSpeed));
target.onEnterFrame = function() {
if (target._x == target.destX) {
delete target.onEnterFrame;
} else {
target._x += Math.ceil((target.destX-target._x)(speed/100));
}
};
}