Hello, I Found this website when I am looking for a Image Pan positioning solution.
eg:http://www.sephiroth.it/tutorials/flashPHP/scrollRect/index.php
Following code is what I found here coded by Krilnon.
Looks like I need to use xy instead of x, anyone know how to archive that?
Many thanks!:ne:
function constrainedMove(target:MovieClip, speed:Number, dir:Number) {
var mousePercent:Number = _ymouse/Stage.height;
var mSpeed:Number;
if (dir == 1) {
mSpeed = 1-mousePercent;
} else {
mSpeed = mousePercent;
}
target.destY = Math.round(-((target._height-Stage.height)*mSpeed));
target.onEnterFrame = function() {
if (target._y == target.destY) {
delete target.onEnterFrame;
} else {
target._y += Math.ceil((target.destY-target._y)*(speed/100));
}
};
}