package{ import flash.display.Sprite; import flash.text.*; public class Main extends Sprite{ public function Main(){ var styleSheet:StyleSheet = new StyleSheet( ); var pStyle:Object = new Object( ); pStyle.fontFamily = "fontName"; styleSheet.setStyle("p", pStyle); var t:TextField = new TextField( ); t.embedFonts = true; t.styleSheet = styleSheet; // Assign styleSheet before assigning htmlText! t.htmlText = "<p>hello world</p>"; } } }
Related Scripts with Example Source Code in same category :