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)));
}
}
精彩评论