Reputation: 207
When I add a TextField on my stage in my Flash project, I have to choose the size (width and height) of the field. If, with programming, I modify that text, I would like that TextField to resize and have the height it needs.
In particular, I am developing a chat application and I would like to wrap every message with typical bubble, but the length of that message may be whatever. In HTML it would be very easy, for example.
How can I do it?
Upvotes: 0
Views: 234
Reputation: 1714
You can just set the autoSize property of the TextField
For Example:
myTextField.autoSize = "left"
If autoSize is set to TextFieldAutoSize.LEFT, the text is treated as left-justified text, meaning that the left margin of the text field remains fixed and any resizing of a single line of the text field is on the right margin. If the text includes a line break (for example, "\n" or "\r"), the bottom is also resized to fit the next line of text.
Upvotes: 2