# Trying to understand how scroll bars work

**URL:** https://forum.kirupa.com/t/trying-to-understand-how-scroll-bars-work/299044
**Category:** Uncategorized
**Created:** [October 28, 2009, 11:28pm UTC](https://forum.kirupa.com/t/trying-to-understand-how-scroll-bars-work/299044 "2009-10-28T23:28:33Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![JohnN](https://avatars.discourse-cdn.com/v4/letter/j/f0a364/32.png) [@JohnN](https://forum.kirupa.com/u/JohnN)
#### Post date: [October 28, 2009, 11:28pm UTC](https://forum.kirupa.com/t/trying-to-understand-how-scroll-bars-work/299044/1 "2009-10-28T23:28:33Z")

</div>

I am very new to flash/Actionscript and am trying to understand how things work before I start any projects.

I was playing with the scroll bar today, and do not understand it’s behavior. I created a  
dynamic text box called my\_text and used the following code

```auto

  for (var i=0;i<50;i++){
        my_text.text += "this is a test" + i + "
";
  }

```

Encouraged that it worked as expected, I tried it a little differently. I added an input text box called called in\_text, and tried the following code.

```auto

in_text.addEventListener(KeyboardEvent.KEY_UP, onInputLineKey);
function onInputLineKey(e:KeyboardEvent):void {
 if (e.keyCode == 13) { // ENTER was pressed
  for (var i=0;i<50;i++){
        my_text.text += in_text.text + i + "
";
        }
 }
}

```

This is what I do not understand. my\_text was populated with the proper data, but my scroll bar was disabled. I could scroll through the list by highlighting the text, but that was it. What did i do wrong

thank you for your help
