0
동적으로 채워지는 텍스트 필드가 있습니다. 채워진 텍스트가 텍스트 필드에 맞지 않으면 텍스트의 크기가 조정됩니다. HTML 태그는 텍스트가 크기가 조정되지 않는 경우에만 동적으로 채워진 텍스트에서 올바르게 작동합니다. HTML 태그는 크기가 조정 된 텍스트에서 무시됩니다. 아이디어가 있으십니까? 텍스트 필드에 대한텍스트 크기가 조정 된 HTML 태그가 작동하지 않습니다.
코드 :
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);
}
}
코드는 텍스트 필드를 채 웁니다 :
function openDialog(e:MouseEvent){
dialog_window.doOpen();
switch(e.currentTarget.name){
case "btn_structure":
dialog_window.setTitle("Business Structure:");
dialog_window.setDesc("This topic discusses the <b>basic</b> structure of the business area.");
break;
case "btn_services":
dialog_window.setTitle("Services Provided:");
dialog_window.setDesc("This topic provides <i>information</i> about the services offered by the Client Billing Services unit.");
break;
}
}
이 경우 HTML 태그는 작동하지만 크기 조정은 수행되지 않습니다. –
이상한, 제 편집을 확인하고 도움이되는지 확인하십시오. – danii
255는 텍스트 상자의 높이입니다. –