Ok, I've been working on scrolling lately. I've got the scrolling code down,
but I need one more step. I would like this panel to stop scrolling if I leave
the panel. The setup is that this is in a movieclip named ClipPaneContainer
that is in the bottom right corner of the stage. It contains a movieclip with
instance name panel that contains thumbnails that are buttons inside, and a
movieclip with instance name stroke that are the stroke of the mask layer I
applied and used as a boundary guide. I know it's some math in there that is
messed up, so please help!
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////
panel.onRollOver = panelOver;
function panelOver() {
this.onEnterFrame = scrollPanel;
delete this.onRollOver;
}
var b = stroke.getBounds; //b as in bounds, target determines boundary
location
function scrollPanel() {
if(_xmouse<b.xMin || _xmouse>b.xMax ||_ymouse<b.yMin || _ymouse<b.yMax) {
//checks if in bounds
this.onRollOver = panelOver;
delete this.onEnterFrame;
}
if(panel._x >= 850) {
panel._x = 850;
}
if(panel._x <= -360) {
panel._x = -360;
}
var xdist = _xmouse; //(stage._x/2) tells where the halfway point is, left
center (-), right center (+)
panel._x += -xdist / 15; //determines speed, bigger is faster, smaller is
slower
}