htmlText will recognize the font tag and textFormat can be set to only certian areas of the text.
Try this:
Code:
createTextField("myText", 1, 0, 0, 200, 30);
createTextField("myText2", 2, 0, 40, 200, 30);
myFormat = new TextFormat();
myFormat.font = "Arial";
myFormat.size = 12;
myFormat.color = 0xFF0000;
myText2.text = "i am some body text";
myText2.setTextFormat(myFormat);
myFormat.bold = true;
myFormat.color = 0x000000;
sIdx = myText2.text.indexOf("body");
eIdx = sIdx + 4;
myText2.setTextFormat(sIdx, eIdx, myFormat);
myFormat.size = 16;
myText.text = "Header 1";
myText.setTextFormat(myFormat);
Or this for htmlText
Code:
createTextField("myText", 1, 0, 0, 200, 30);
createTextField("myText2", 2, 0, 40, 200, 30);
myText.html = true;
myText2.html = true;
myText.htmlText = "<font face=\"arial\" color=\"#000000\" size=\"18\"><b>Header 1</b></font>";
myText2.htmlText = "<font face=\"arial\" color=\"#FF0000\">i am some <font color=\"#000000\"><b>body</b></font> text</font>";
Bookmarks