TextField autosizing options

Actionscript 3 in Flash player 9 came with four different ways to automate the sizing of a text field depending of its contents. The following piece of code shows how each of these “TextFieldAutoSize” constants differ when set prior of setting the content of the text field.

The other constants tested here, the “TextFormatAlign”, have no effect if the autosize is other than “none”.

Source code example TextAutoSizing.as now available at GitHub.

The attached swf file is the output of the code.