As we all know, Flash has these crazy bugs nobody ever understands. One of those is the fact that the last character of a dynamic textfield (which has been set to “AutoSize”) gets cut off when you’re using an embedded font. Up till now I still don’t understand what kind of situation leads to this exceptional behavior. The only thing I can say is that Flash Player fails to determine the correct text length which screws up the textfield width to be shorter than it has to be.
Example:
A quicktip post wouldn’t be a quicktip post without a solution. So, here’s one of the tricks you might give a go: increase the rightMargin property of the TextField to a small value like 1 or 2.
var textFormat:TextFormat = new TextFormat(); textFormat.rightMargin = 1; textField.antiAliasType = AntiAliasType.ADVANCED; textField.gridFitType = GridFitType.SUBPIXEL; textField.embedFonts = true; textField.autoSize = TextFieldAutoSize.CENTER; textField.defaultTextFormat = textFormat; textField.setTextFormat(textFormat);
Hope this helps!


March 4, 2010
You made my day (actually, night). Thanks!!