这将需要一些工作,但您想要的基本想法是:
//horizontal panning only
initial_x = myImage._x;
myImage.onRollOver = function() {
startPanning = 1; //starts panning when the mouse rolls over the image
}
myBorder.onRollOver = function() {
startPanning = 0;
//stops panning when the mouse rolls over the border
//the border that's ontop of the image
//(like the one in your example)
//this way the mouse can roll off the image
//and only part of the image is shown at one time
//the rest is hidden by the border.
}
myImage.onEnterFrame = function() {
if (startPanning == 1) {
myImage._x = (initial_x-((_xmouse)-(initial_x)));
}
}