PDA

View Full Version : Scrollbar Component


shotsy247
07-12-2005, 10:31 PM
I'm creating a dynamically built control panel that contains a textbox and a scrollbar. This is all resizable. It will load external text, bla, bla, bla.

Everything is working fine except the scrollbar doesn't show all of the text. When I scroll down, there is still a line or two of text. This seems like a percentage, because the more text I put in the field, the larger the amount that doesn't get shown when the scrollbar is scrolled all the way down.

The problem fixes itself when I resize the toolbox, using the small triangle button on the bottom right. Clicking this you can see the scrollbar jump a little.

I't a lot of code, but perhaps someone can help with a solution. My brain is spent right now.

Thanks.

_t

subquark
07-13-2005, 01:04 PM
create a textfield in the library and link it! I guess this is too tough for anyone to figure out . . .

shotsy247
07-14-2005, 01:51 PM
Nope that didn't work.

I did however find a hack around for this problem. In case anyone is interested, I put an onEnterFrame after everything was created. This onEnterFrame cycled through two times then killed itself. Each time it reattached the scrollbar and reset it's size and position.


this.onEnterFrame = function(){
holder.scroller.removeMovieClip();
holder.attachMovie("UIScrollBar", "scroller", holder.getNextHighestDepth());
holder.scroller.setScrollTarget(holder.tb);
holder.scroller.visible = (holder.tb.maxscroll != 1);
holder.scroller.setSize(10, holder.tb._height + 1);
holder.scroller._x = holder.tb._x + holder.tb._width + 2;
holder.scroller._y = holder.tb._y;
i++;
if(i >= 1){
delete this.onEnterFrame;
}
}

_t