Using embedded fonts with the Flash CS3 Button control

The following example shows how you can use embedded fonts (normal weight and bold weight) with a Flash CS3 Button control.

Full code after the jump.

const STR:String = "The quick brown fox";var f2:Font = new EmbeddedVerdana() as Font;var f3:Font = new EmbeddedVerdanaBold() as Font;var tf1:TextFormat = new TextFormat();tf1.font = "Verdana";var tf2:TextFormat = new TextFormat();tf2.font = f2.fontName; // Verdanavar tf3:TextFormat = new TextFormat();tf3.font = f3.fontName; // Verdanatf3.bold = true;button1.label = STR;button1.setStyle("textFormat", tf1);button2.label = STR;button2.setStyle("embedFonts", true);button2.setStyle("textFormat", tf2);button3.label = STR;button3.setStyle("embedFonts", true);button3.setStyle("textFormat", tf3);

Download FLA