The following code is working correctly for me in a blank project:
var tabScroller = new ScrollContainer();
tabScroller.showScrollBars = false;
this.addChild(tabScroller);
var child = new Label("Hello");
child.x = 190;
tabScroller.addChild(child);
tabScroller.width = 200;
tabScroller.validateNow();
if (tabScroller.maxScrollX != 0) {
trace("ScrollContainer has scroll", tabScroller.maxScrollX);
} else {
trace("ScrollContainer has no scroll", tabScroller.maxScrollX);
}
Because 190 + child.width > 200, it means that maxScrollX > 0.
If I don't add the child, then it correctly determines that it doesn't need to scroll, and maxScrollX == 0.