I have a hierarchy of objects in my Actionscript. I use Actionscript because all objects are dynamic, built at run-time on the basis of data from the server.
SxText (my class) is a subclass of RichEditableText which implements IViewPort
Typical code is:
public class SxText extends RichEditableText
sxText = new sxText(....);
scroller = new Scroller();
group = new Group();
scroller.viewport = group;
It looks great and I can control location and size, as well as detect the events that I'm interested in.
But, the scroll bar thumb fills the vertical space of the bar.
I've tried many methods to enable or to set viewport content size, but the following code has no effect.
scrollerSkin = ScrollerSkin(scroller.skin);
scrollBar = scrollerSkin.verticalScrollBar;
vbarSkin = VScrollBarSkin(scrollBar.skin);
thumb = vbarSkin.thumb;
I'm guessing that I'm missing the one method that will do it. Thanks.
After posting, I kept trying. This works, making the thumb usable.
This code is called in an event handler of the scroller for UPDATE_COMPLETE
group.setContentSize( good values for dx and dy );
Thanks for listening.
Actually, there is a more complete answer in a similar discussion that I started. "Scroller in Actionscript" will probably get you there.