Scrollpane

Hello :slight_smile:

I’ve been searching for a tutorial/info on how to make a scrollpane ‘follow the mouse’ and I’m hoping someone could shed some light on this. An example of what im looking for can be found here.

The problem with the current scrollpane im using is that the thumbnails keep moving away and escape the mouse as i hover over them, unless the thumbnail is pretty much in the middle. Hopefully my description made sense :nerd:

heres the code:
[COLOR=SlateGray]
[/COLOR][COLOR=DimGray][COLOR=SlateGray]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 &gt;= 148) {
    panel._x = 148;
}


if(panel._x &lt;= -20) {
    panel._x = -20;
}

var xdist = _xmouse - 400;

panel._x += -xdist /100;


}[/COLOR]

[COLOR=Black]Any help would be greatly appreciated :slight_smile: thanks

[/COLOR][/COLOR]