views:

37

answers:

2

I have a dynamic text box in a Flash AS3 project. I've attached a UIScrollBar component to it which works great if there's more text than display room.

I want to be able to hide the scrollbar when there's more display room than text. I can't seem to find anything about it in AS3. Does anyone know the property I should be looking for to see if the scrollbar should be displayed or not?

Thanks, Ryan.

A: 

add a conditional to hide it when tf.textHeight > tf.height

Daniel
Thanks, I feel like an idiot now.
Ryan SMith
A: 

just set the visible property of the UIScrollBar to false when not required. For eg :

scrollBar.visible = textbox.text.length < MaxLength ? false:true;

where

  • scrollBar : The instance name of UI Component u added.
  • textBox : The instance name of textbox.
  • MaxLength : The integral length beyond which scollBar should be made visible.
loxxy