开发者

Flash XML whitespace problem

How can I have Flash reading XML ignore white spaces that would be ignored in HTML?

<![CDATA[
   Some text here.
   More text here.             ]]>

I don't wa开发者_开发问答nt the spaces or the new lines that show in the text to show in Flash. In HTML there is no new line character between the two lines either.

Is that possible? Thank you.


When you add your text to a textField you need to use the condenseWhite property. condenseWhite only works on htmlText. So do something like:

txt.condenseWhite = true;
txt.htmlText = myXML.myNode[0];

I remember at some point a few years ago I had a program where I wasn't using htmlText and it took me ages to figure out that condenseWhite doesn't work with the regular old text property, so remember this only works with htmlText. Hope this helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜