2011-05-16 73 views
0

我正在ActionScript 2.0开发项目。我有一个平铺的图像。我跟着这个教程: http://www.kirupa.com/developer/flash8/interactive_image_pan.htm图像平移区域

现在我想要图像平移只是当鼠标悬停一些movieclip而不是整个舞台。当鼠标悬停在动画片剪辑的左边限制上时,图像将移动到该限制。像这样一个(除了我不想垂直平移): http://www.oxylusflash.com/files/1027/index.html

任何帮助?? 在此先感谢

回答

0

这将需要你想找个工作,但其基本思想是:

//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))); 

    } 

}