How to create a multi-line TextField?

I have a line that is too long to fit in my 100px container. I want to make TextField automatically multi-line if necessary. How to do it?

+4
source share
2 answers

I think you are looking for TextFieldAutoSize .

 var tf:TextField = new TextField(); tf.multiline = true; tf.wordWrap = true; tf.autoSize = TextFieldAutoSize.LEFT; tf.text = yourLongStringVar; 

See the documentation for more information.

EDIT: added wordwrap and multiline properties to maintain width

+8
source

Have you tried using TextField.multiline or .wordWrap?

 var tf:TextField = new TextField(); tf.multiline = true; tf.wordWrap = true; // etc.. 
+3
source

All Articles