In a TextField
, non-HTML text is actually placed within a set of paragraph tags. As an experiment:
var tf:TextField = new TextField();
tf.text = "hello world";
trace(tf.htmlText);
The trace output will be:
<P ALIGN="LEFT"><FONT FACE="Times New Roman" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">hello world</FONT></P>
Because there is a nested FONT element that "hardcodes" the styling information, the answer to the original question is no, plain text TextFields cannot have their font properties styled using a StyleSheet. Use defaultTextFormat
or setTextFormat()
instead.