Sunday, February 20, 2011

auto hide/show UIScrollBar after updating text AS3

// after updating the text (can be text or htmlText)...

my_textfield.scrollV = 0; // reset the scroll to the top
my_scrollbar.update(); // make sure the scrollbar knows it's been changed
if (my_scrollbar.maxScrollV <= 1) {
    my_scrollbar.visible = false;
} else {
    my_scrollbar.visible = true;
}

No comments: