我正在用Actionscript 2.0开发一个项目。我有一个平移的图像。我遵循了本教程:http://www.kirupa.com/developer/flash8/interactive_image_pan.htm
现在,我希望图像在鼠标悬停在某个影片剪辑而不是整个舞台上时平移。当鼠标悬停在影片剪辑的左限制处时,图像将平移到该限制。像这个(除了我不想要垂直平移):http://www.oxylusflash.com/files/1027/index.html
有什么帮助吗??提前致谢
这需要一些工作,但您想要的基本思想是:
//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)));
}
}