Maximum text field width AS3

How to set the maximum width of the text box?
I need an automatic width until it reaches the maximum width, so the text will be split into lines.

+4
source share
1 answer
var maxWidth:Number = 200; textField.multiline = false; textField.wordWrap = false; textField.autoSize = TextFieldAutoSize.LEFT; textField.text = "Lorem ipsum"; if (textField.width > maxWidth) { textField.multiline = true; textField.wordWrap = true; textField.width = maxWidth; } 
+5
source

Source: https://habr.com/ru/post/1414152/


All Articles