Posted By

codism on 06/30/11


character letter cropped

Versions (?)

Cropped Last Character on static text field

 / Published in: ActionScript 3


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:

  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  

You need to login to post a comment.