Enterprise APP

html/text 컴포넌트 width사이즈 값 계산 본문

Flex General/Tips

html/text 컴포넌트 width사이즈 값 계산

로드스타 2010. 8. 14. 19:08
var agTYHTML:Label = new Label();//TextArea, Text...
    var str:String = StringUtil.substitute("<font size='-1'>최저연령 기준으로 <b>{0}</b>께서는 <b><font color='0x9b1b6c'>{1}</font></b>에 해당합니다.</font>", driverInfo.name, driverInfo.ageTY);
    agTYHTML.htmlText = str;
    agTYHTML.regenerateStyleCache( false );
    var textMetrics:TextLineMetrics = agTYHTML.measureHTMLText(str);
    var textWidth:int = textMetrics.width;
    agTYHTML.width = textWidth + 15;
    bottomTY.addElement(agTYHTML);
Comments