# Scrollbar component

**URL:** <https://forum.kirupa.com/t/scrollbar-component/493>\
**Category:** flash\
**Created:** [July 19, 2002, 8:05am UTC](https://forum.kirupa.com/t/scrollbar-component/493 "2002-07-19T08:05:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pom](https://avatars.discourse-cdn.com/v4/letter/p/f07891/32.png) [@pom](https://forum.kirupa.com/u/pom)\
**Post date:** [July 19, 2002, 8:05am UTC](https://forum.kirupa.com/t/scrollbar-component/493/1 "2002-07-19T08:05:01Z")

</div>

I’m full of questions 😛  
So the thing is I have an input text (comment) with a scrollbar (bar) and I’d like it to visible only if it needs to. I wrote this

```auto
comment.onChanged = function(){
	if (this.maxscroll>1) {
		_root.bar._visible=true;
	}
	else _root.bar._visible=false;
}

```

but the problm is that the scrollbar appears but isn’t active. Any idea ?

pom :asian:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 19, 2002, 12:00pm UTC](https://forum.kirupa.com/t/scrollbar-component/493/2 "2002-07-19T12:00:38Z")

</div>

I tried the code that you supplied and it works for me. when I enter text into the text box with the name comment, the scroll bar disappears. When there is enough text in the text box, the bars reappears.

I don’t know why it would not work with you.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 19, 2002, 2:26pm UTC](https://forum.kirupa.com/t/scrollbar-component/493/3 "2002-07-19T14:26:52Z")

</div>

Well, it didnt work for me, until I made the following change:

\_root.bar.\_visible=false;

```
comment.onChanged = function(){
if (this.maxscroll&gt;1) {
_root.bar._visible=true;
}
else _root.bar._visible=false;

```

}

this was, of course, all on frame 1

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 19, 2002, 6:17pm UTC](https://forum.kirupa.com/t/scrollbar-component/493/4 "2002-07-19T18:17:33Z")

</div>

I had tried that already and it didn’t seem to work. Can you send me a fla that works ?

pom :asian:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 19, 2002, 6:24pm UTC](https://forum.kirupa.com/t/scrollbar-component/493/5 "2002-07-19T18:24:54Z")

</div>

I hope this helps. It works for me.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 19, 2002, 6:32pm UTC](https://forum.kirupa.com/t/scrollbar-component/493/6 "2002-07-19T18:32:09Z")

</div>

Thanks Dijon (must I understand that you’re French ?), but I removed the scrollbar and put another, and it now works perfectly. Go figure…

Thanks also Inigo.

pom :asian:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 19, 2002, 7:08pm UTC](https://forum.kirupa.com/t/scrollbar-component/493/7 "2002-07-19T19:08:12Z")

</div>

no prob! That’s why we’re here, to help each other out.

☹

heheh
