Jan 7, 2010
Quicktip #6: Fixing the cut off character on embedded-font-textfields
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!

You made my day (actually, night). Thanks!!
Excellent! I was wondering how to solve this. This little solution was a lot of help. Thanks!
Thanks a load!! Been trying to sort this for ages. I hate flash sometimes.
Lol! I’ve been figuring out this problem (on my own) for years when i’ve decided just now, “Why not search it on Google?”
Thanks!
Thanks dude. Very helpful, was pulling my hair out all afternoon even though my client didn’t care.