# Can't hide a scrollbar?

**URL:** <https://forum.kirupa.com/t/cant-hide-a-scrollbar/259654>\
**Category:** Uncategorized\
**Created:** [May 7, 2008, 2:43pm UTC](https://forum.kirupa.com/t/cant-hide-a-scrollbar/259654 "2008-05-07T14:43:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![keitai](https://avatars.discourse-cdn.com/v4/letter/k/73ab20/32.png) [@keitai](https://forum.kirupa.com/u/keitai)\
**Post date:** [May 7, 2008, 2:43pm UTC](https://forum.kirupa.com/t/cant-hide-a-scrollbar/259654/1 "2008-05-07T14:43:29Z")

</div>

```auto

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
