This content has been marked as final. Show 4 replies
>>However, when I do tabs and even carriage returns inside my CDATA, and
>>then set the htmlText attribute of a TextField to what's in the
CDATA, all the tabs and carriage returns are being displayed.
Don't do that. Formatting of your CDATA element should be taken care of by
the HTML attributes you're using, not by putting tabs and breaks in the
Adobe Community Expert
I am formatting my CDATA element with HTML, which is then going into the HTML text. However, I want to format my XML file with tabs and whitespaces, so it's readable. I also want to format the CDATA so it's readable, the same way you would use tabs and carriage returns in a regular HTML file. I should be able to make my CDATA readable and not have it effect the textField, especially since I'm setting .htmlText and not .text. I'm pretty sure if I put whitespace and carriage returns in an external file and then load it in using loadVariables() into the .htmlText attribute of a textField, it doesn't effect my formatting of the textField, so why does it in CDATA?
I've been playing with exactly the same problem in the last couple of weeks. This is Antonio de Donatis' solution and it works fine when loading simple text files. Hope it helps:
I suppose we could call this a "fix"! I'm not sure why it's showing up to begin with. I've expanded it to include tabs
I guess this is also the alternative because there's no replace function for strings in flash AS 2.0. I just hope there's never a time when there's a \n without an \r or vice versa.