This post details how to embed fonts with only AS3.
Took a good 2 hours to come across the right information. Hopefully somebody else can benefit from this as well.
It looks like if you ever need to change the alpha on a TextField you need to embed the font. Here are the basics.
/// EMBED FONT /// [Embed(source = "path_to_font", fontName= "myFont")] public static var myFont:Class; Font.registerFont(path_to_font_class); /// CREATE TFORMAT /// var format:TextFormat = new TextFormat(); format.font="myFont" /// CREATE TFIELD /// var tf:TextField = new TextField(); tf.embedFonts = true; tf.defaultTextFormat = format;
Now you are finally good to go. tf.alpha=0, and sure enough, it works.
3 responses so far ↓
Issues embedding OpenType Fonts in Flash « Yuji finds a cow. // May 2, 2008 at 1:52 am |
[...] it, or using some hack like turning it into a bitmap and changing the alpha on that. Look at this previous post for how to embed the fonts for alpha [...]
jav666 // September 26, 2009 at 10:02 pm |
the “thispost” URI is offline.
do you have a backup?
Yuji // October 9, 2009 at 5:21 pm |
Looks like it’s gone. I don’ t have a backup, but there is an example in my post : )