Embedding Fonts in AS3 Only.

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;
var format:TextFormat = new TextFormat();
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 thoughts on “Embedding Fonts in AS3 Only.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s