/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// To use this method you must embed and "Export for AS" the font in the Flash IDE (eg. Flash CS3, Flash CS4). // You Can do this by clicking the menu on the library panel, then go "New Font" // Then select "Export for Actionscript, and give your font class name. // The class name is the name that you will reference on the line directly below this. var myFont = new MyFontClassName(); var myFormat:TextFormat = new TextFormat(); myFormat.size = 40; myFormat.font = myFont.fontName; var myText:TextField = new TextField(); myText.defaultTextFormat = myFormat; myText.embedFonts = true; myText.antiAliasType = AntiAliasType.ADVANCED; myText.autoSize = "left"; myText.text = "Here is some pretty that is anti-aliased!"; addChild(myText);
URL: http://www.republicofcode.com/tutorials/flash/as3text/