PDA

View Full Version : HTMLLoader + ScrollBar = tiny thumb


midimid
01-05-2009, 09:53 PM
Almost every AIR article covering loading HTML into the HTMLLoader class includes placing horizontal and vertical ScrollBar instances along the border.

What's bizarre is after loading the HTML (via .load() or .loadString()) and being sure to update the scrollbars afterwards, the thumb for the scrollbar is almost always very very small when compared to the amount of content in the window.

Anyone else run into this?

Here;s my update scroll bars function if it helps at all ("browser" is the HTMLLoader instance):

private function updateScrollBars():void {
if (browser.contentHeight > browser.height) {
vScrollbar.enabled = true;
vScrollbar.visible = true;
vScrollbar.minScrollPosition = 0;
vScrollbar.maxScrollPosition =browser.contentHeight - browser.height;
} else {
vScrollbar.enabled = false;
vScrollbar.visible = false;
}
if (browser.contentWidth > browser.width) {
hScrollbar.enabled = true;
hScrollbar.visible = true;
hScrollbar.minScrollPosition = 0;
hScrollbar.maxScrollPosition = browser.contentWidth - browser.width;
} else {
hScrollbar.enabled = false;
hScrollbar.visible = false;
}
}

midimid
02-09-2009, 06:11 PM
Finally coming back to this after putting it aside for a month.

Has no one else run into this issue? I'm attaching some jpgs that hopefully highlight the issue.


In the case below, I've added a single bit of text between pic1 and pic2, so that the vertical scrollbar becomes visible. Notice the size of the thumb scroller (where you click to drag) - in a normal browser window, if there was only a single extra line of text, the thumb would be almost the entire distance of the scrollable area. Here however, its only half. It becomes increasingly smaller as you add text. What is causing this?

http://qnotemedia.com/upload/pic1.jpg
http://qnotemedia.com/upload/pic2.jpg
http://qnotemedia.com/upload/pic3.jpg
http://qnotemedia.com/upload/pic4.jpg