I’ve scoured several places online for an answer to this, but I only find posts asking the same question without any answers. I would appreciate any guidance on this.
I’ve successfully implemented a looping MC slider (w/ buttons) that eases horizontally according to mouse position. The problem is, I can’t get the slider to stop moving when the mouse is outside of the slider MC area. My slider MC is loaded into a layer above my main movie, and I would like to retain the functionality of the links on the main timeline without the distraction of the moving horizontal slider. In any event, I can’t even find a way to constrain the relative mouse action at all.
Here is the basic AS I am using:
panel.onRollOver = panelOver;
function panelOver() {
this.onEnterFrame = scrollPanel;
delete this.onRollOver;
}
var b = stroke.getBounds(_root);
function scrollPanel() {
if(_xmouse<b.xMin || _xmouse>b.xMax || _ymouse<b.yMin || _ymouse>b.yMax) {
this.onRollOver = panelOver;
delete this.onEnterFrame;
}
if(panel._x >= -121) {
panel._x = -1825;
}
if(panel._x <= -1847) {
panel._x = -140;
}
var xdist = _xmouse - 250;
panel._x += Math.round(-xdist / 10);
}