【发布时间】:2011-05-20 13:02:05
【问题描述】:
我有一个使用 AS3 创建的文本字段,如下所示:(theDesc 是通过函数传递的参数)
var productDescTxt:TextField = new TextField();
productDescTxt.htmlText = theDesc;
productDescTxt.multiline = true;
productDescTxt.wordWrap = true;
productDescTxt.embedFonts = true;
productDescTxt.setTextFormat(productInfoTF);
productDescTxt.x = 10;
productDescTxt.y = productNameTxt.y+productNameTxt.textHeight+15;
productDescTxt.width = 325;
holder.productsTab.addChild(productDescTxt);
theDesc是带有字符编码的html内容:
例如:
<p><strong>6.1 oz cotton at an affordable price</strong></p>
问题是 textField 正在显示每个字符。 <p><strong>等
我需要做额外的编码吗?
【问题讨论】:
-
theDesc 在你设置的地方是什么样子的?
-
它被作为一个字符串传递,就像我的例子一样。
-
喜欢这个 <p><strong>6.1 盎司棉花,价格实惠</strong></p>?
-
是的。像我的例子一样,一个字符一个字符。
-
那你为什么不用服务器端语言来做 html_decode 或者直接输入 xml 或字符串呢?
标签: actionscript-3 textfield htmltext