2011-05-16 71 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))); 

    } 

}