(I cross-posted to Sephiroth as well…)
Extend the functionality of the UIScrollBar class and override the function where the thumb skin is scaled proportionate to the track.
The attached files are based on the Adobe Flash_ActionScript3.0_samples>LoadText.
In your .fla, you will have:
import UIScrollBar_thumb;
//Handle the UIScrollBar - instance in library
var my_sb:UIScrollBar_thumb = new UIScrollBar_thumb();
addChild(my_sb);
So instead of using “UIScrollBar” you are using the new subclass “UIScrollBar_thumb” that is defined in UIScrollBar.as which should be in the folder where your .fla is…or you can put it somewhere else and make sure you change the import path and the package path.
UIScrollBar.as contains:
package
{
import fl.controls.ScrollBar;
import fl.controls.UIScrollBar;
public class UIScrollBar_thumb extends fl.controls.UIScrollBar
{
public function UIScrollBar_thumb()
override protected function updateThumb():void {
var per:Number = maxScrollPosition - minScrollPosition + pageSize;
if (track.height <= 12 || maxScrollPosition <= 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;
}
}
}
}