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
source share