/ Published in: ActionScript 3
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:
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
Copy this code and paste it in your HTML
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);
URL: http://www.actionscript.org/forums/showthread.php3?t=184888