Cropped Last Character on static text field

/ Published in: ActionScript 3
Save to your folder(s)

OK sorted it with some mates from
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:

Copy this code and paste it in your HTML
  1. Code:
  2. _HomeMenuButtons[i].btn_txt.autoSize = TextFieldAutoSize.LEFT;
  3. _HomeMenuButtons[i].btn_txt.text = _menuElements[i];
  4. var wid:Number = _HomeMenuButtons[i].btn_txt.width;
  5. _HomeMenuButtons[i].btn_txt.autoSize = TextFieldAutoSize.NONE;
  6. _HomeMenuButtons[i].btn_txt.width = wid + 20;
  7. _HomeMenuButtons[i].btn_txt.defaultTextFormat = MenuFormat;
  8. _HomeMenuButtons[i].btn_txt.setTextFormat(MenuFormat);


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.