# Hide or Show Scrollbar for Multiline INPUT Textfield

**URL:** https://forum.kirupa.com/t/hide-or-show-scrollbar-for-multiline-input-textfield/327236
**Category:** flash
**Created:** [February 14, 2012, 10:57pm UTC](https://forum.kirupa.com/t/hide-or-show-scrollbar-for-multiline-input-textfield/327236 "2012-02-14T22:57:07Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Reinhardt](https://avatars.discourse-cdn.com/v4/letter/r/8e8cbc/32.png) [@Reinhardt](https://forum.kirupa.com/u/Reinhardt)
#### Post date: [February 14, 2012, 10:57pm UTC](https://forum.kirupa.com/t/hide-or-show-scrollbar-for-multiline-input-textfield/327236/1 "2012-02-14T22:57:07Z")

</div>

Hello people!

I am at my wits end here. I have tried to search everywhere, but cant find a sollution…

**Backgorund:**  
I use AS3 which I keep separate from my fla project.

I have a contact page and the textfield where you type your message is an Input textfield with multiline and textwrap enabled. The height of my textfield allows for 5 lines of text, then you will have to start scrolling after that.

I use a my own scroll bar nested in a movieclip with instance name “txtScroller”  
The Input textfield instance name is “messageText”

**What I want to do:**  
I want to hide the “txtScroller” mc and show it when the user has typed more than 5 lines of text (using enter to break to a new line, etc).

**Now for my problem:**  
The first part of the code works, the “txtScroller” mc is hidden, and I have even tested it with the trace function (see code bellow).

I can for the life of me NOT get the the second part to work, the part where i want to show “txtScroller” mc again. I’ve treid with the trace function as well but it shows nothing in the ‘output’ pannel (see code bellow).

If anyone knows a sollution i would be really glad!

**The Code:**  
This is all I have with regards to hiding or showing the “txtScroller” mc.

```auto
if (messageText.numLines <= 5) {
    trace("less");
    txtScroller.visible = false;
    
}

if (messageText.numLines > 6) {
    trace("more");
    txtScroller.visible = true; 
} 

```
