# ScrollPane Thumb--make it a fixed size

**URL:** <https://forum.kirupa.com/t/scrollpane-thumb-make-it-a-fixed-size/230411>\
**Category:** flash\
**Created:** [June 26, 2007, 3:06am UTC](https://forum.kirupa.com/t/scrollpane-thumb-make-it-a-fixed-size/230411 "2007-06-26T03:06:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mbagg](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@mbagg](https://forum.kirupa.com/u/mbagg)\
**Post date:** [June 26, 2007, 3:06am UTC](https://forum.kirupa.com/t/scrollpane-thumb-make-it-a-fixed-size/230411/1 "2007-06-26T03:06:20Z")

</div>

So I’ve created a small class extension with an override function to stop the thumb from scaling on the UIScroller…but I can’t seem to figure out how to do the same for the scrollpane.

Any ideas?

Below you can see that I extend the UIScroller, override the ‘updateThumb()’ function in the ScrollBar class and merely comment out one line:

```
            thumb.height = 12;

```

// thumb.height = Math.max(13,pageSize / per \* track.height);

How can I do the same for the ScrollPane?

Here’s the UIScroller extension:

package  
{  
import fl.controls.ScrollBar;  
import fl.controls.UIScrollBar;  
public class ScrollPane\_thumb extends fl.controls.UIScrollBar  
{

```
    public function ScrollPane_thumb()

    override protected function updateThumb():void {
        var per:Number = maxScrollPosition - minScrollPosition + pageSize;
        if (track.height &lt;= 12 || maxScrollPosition &lt;= minScrollPosition || (per == 0 || isNaN(per))) {
            
            thumb.height = 12;
            thumb.visible = false;
        } else {
            thumb.height = 12;

```

// thumb.height = Math.max(13,pageSize / per \* track.height);  
thumb.y = track.y+(track.height-thumb.height)\*((scrollPosition-minScrollPosition)/(maxScrollPosition-minScrollPosition));  
thumb.visible = enabled;  
}  
}  
}  
}
