function makeScroll(textToScroll) {
textToScroll.createClassObject(mx.controls.UIScrollBar, "my_sb", textToScroll.getNextHighestDepth());
// Set the target text field for the scroll bar.
my_sb.setScrollTarget(textToScroll);
// Size it to match the text field.
my_sb.setSize(16, textToScroll._height);
// Move it next to the text field.
my_sb.move(textToScroll._x + textToScroll._width, textToScroll._y);
if(textToScroll.textHeight > textToScroll._height) {
trace("scroll");
textToScroll.my_sb._visible = true;
} else {
trace("no scroll");
textToScroll.my_sb._visible = false;
}
}
//usage
test.contentTxt.text = "challenge, there is evolution. In response to the the incredible challenges faced ....";
makeScroll(test.contentTxt);
but i still see the background of the scrollbar my_sb
any ideas