I have a string that is too long to fit into my 100px container. I want to make TextField
automatically multiline if needed. How do I make it?
I think what you're looking for is TextFieldAutoSize
.
var tf:TextField = new TextField();
tf.multiline = true;
tf.wordWrap = true;
tf.autoSize = TextFieldAutoSize.LEFT;
tf.text = yourLongStringVar;
For more information check out the documentation.
EDIT : added wordwrap and multiline properties to maintain width
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With