# Scrollpane

**URL:** <https://forum.kirupa.com/t/scrollpane/228812>\
**Category:** Uncategorized\
**Created:** [June 11, 2007, 6:49pm UTC](https://forum.kirupa.com/t/scrollpane/228812 "2007-06-11T18:49:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cotton](https://avatars.discourse-cdn.com/v4/letter/c/c6cbf5/32.png) [@Cotton](https://forum.kirupa.com/u/Cotton)\
**Post date:** [June 11, 2007, 6:49pm UTC](https://forum.kirupa.com/t/scrollpane/228812/1 "2007-06-11T18:49:30Z")

</div>

Hello 🙂

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](http://www.smalltime.co.uk/).

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 🙂 thanks

[/COLOR][/COLOR]
