开发者

image panning area

I'm developing a project in Actionscript 2.0. I have an image that pans. I followed this tutorial: http://www.kiru开发者_如何学运维pa.com/developer/flash8/interactive_image_pan.htm

Now I want the image to pan just when the mouse is hover some movieclip instead of the whole stage. When the mouse is hover of the left limit of the movieclip, the image pans to that limit. Like this one (except I don't want vertical panning): http://www.oxylusflash.com/files/1027/index.html

Any help?? Thanks in advance


This will need some work but the basic idea you want is:

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

    }

}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜