【发布时间】:2011-07-20 11:55:14
【问题描述】:
如何让 Flash 读取 XML 忽略 HTML 中会忽略的空格?
<![CDATA[
Some text here.
More text here. ]]>
我不希望文本中显示的空格或换行符在 Flash 中显示。在 HTML 中,两行之间也没有换行符。
这可能吗?谢谢。
【问题讨论】:
标签: xml flash whitespace removing-whitespace
如何让 Flash 读取 XML 忽略 HTML 中会忽略的空格?
<![CDATA[
Some text here.
More text here. ]]>
我不希望文本中显示的空格或换行符在 Flash 中显示。在 HTML 中,两行之间也没有换行符。
这可能吗?谢谢。
【问题讨论】:
标签: xml flash whitespace removing-whitespace
当您将文本添加到 textField 时,您需要使用 condenseWhite 属性。 condenseWhite 仅适用于 htmlText。因此,请执行以下操作:
txt.condenseWhite = true;
txt.htmlText = myXML.myNode[0];
我记得几年前的某个时候,我有一个没有使用 htmlText 的程序,我花了很长时间才发现 condenseWhite 不适用于常规的旧文本属性,所以请记住这只适用于html文本。希望这会有所帮助。
【讨论】: