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 = "hello world
";
}
}
}