/ Published in: ActionScript 3
URL: http://www.actionscript.org/forums/showthread.php3?t=184888
OK sorted it with some mates from TwentySixLeeds.com What you need to do is grab the length of the text, then knock off the autosize and then pad it! Code would look something like this:
Expand |
Embed | Plain Text
Code: _HomeMenuButtons[i].btn_txt.autoSize = TextFieldAutoSize.LEFT; _HomeMenuButtons[i].btn_txt.text = _menuElements[i]; var wid:Number = _HomeMenuButtons[i].btn_txt.width; _HomeMenuButtons[i].btn_txt.autoSize = TextFieldAutoSize.NONE; _HomeMenuButtons[i].btn_txt.width = wid + 20; _HomeMenuButtons[i].btn_txt.defaultTextFormat = MenuFormat; _HomeMenuButtons[i].btn_txt.setTextFormat(MenuFormat);
You need to login to post a comment.
