HTML Tags Don't Work When Text Resized
I have a text field that gets populated dynamically. If the populated text doesn't fit in the text field, the text gets resized. HTML tags work correctly in the dynamically populated text, but only if the text doesn't get resized. HTML tags are completely ignored in resized text. Any ideas?
Code to format the text field:
import flash.text.TextFormat;
import flash.text.Font;
//
function setDesc(str:String):void{
var fmtD:TextFormat;
var cfmtD:TextFormat = this.desc_txt.getTextFormat()==null ? this.desc_text.defaultTextFormat : this.desc_txt.getTextFormat();
var sizeD:int = 22;
desc_txt.htmlText = str;
while (sizeD>10 && sizeD<23 && desc_txt.textHeight>255){
sizeD--;
fmtD = new TextFormat(descFont.fontName,sizeD,0x000000,false,false,false);
desc_txt.htmlText str;
desc_txt.setTextFormat(fmtD);
}
}
Code to populate the text field:
function openDialog(e:MouseEvent){
dialog_window.doOpen();
switch(e.currentTarget.name){
case "btn_structure":
dialog_window.setTitle("Title #1 Goes Here");
dialog_window.setDesc("Topic description goes here.");
break;
case "btn_services":
dialog_window.setTitle("Title #2 Goes Here");
dialog_window.setDesc("<b>Topic</b> description goes <i>here</i>.");
break;
}
}