# Set TextFieldAutoSize property via String.. Easy?

**URL:** <https://forum.kirupa.com/t/set-textfieldautosize-property-via-string-easy/318974>\
**Category:** Uncategorized\
**Created:** [February 4, 2011, 10:36pm UTC](https://forum.kirupa.com/t/set-textfieldautosize-property-via-string-easy/318974 "2011-02-04T22:36:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![FlashUserNull](https://avatars.discourse-cdn.com/v4/letter/f/f475e1/32.png) [@FlashUserNull](https://forum.kirupa.com/u/FlashUserNull)\
**Post date:** [February 4, 2011, 10:36pm UTC](https://forum.kirupa.com/t/set-textfieldautosize-property-via-string-easy/318974/1 "2011-02-04T22:36:14Z")

</div>

Anybody know the proper syntaxt for setting the textField’s Auto Size property from a String?

var myTextField:TextField;  
myTextField = new TextField();

myTextField.autoSize=TextFieldAutoSize.LEFT; //Default way Works fine

var string:String = “TextFieldAutoSize.Left”;  
myTextField.autoSize=[string]; //Doesnt work

var string:String =“LEFT”;  
myTextField.autoSize=TextFieldAutoSize[string] //Works but i need everything on the right of the equals sign to be information “from the string”
