doesn't read XML line breaks
Here's a portion of my XML file:
<?xml version="1.0" encoding="utf-8"?>
<personagequotes>
<personage>
<fragment>
<quote>This is a text.\n This line should be the second but isn't</quote>
<film>001.flv</film>
</fragment>
...
I'm using this code to read the XML and put the content of node 0 in a textfield:
var personageQuotes_XML:XML;
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(new URLRequest("quotes.xml?rand="+Math.random()*1000));
xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
xmlLoader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
//;
function errorHandler(event:IOErrorEvent):void
{
//error
}
//
function xmlLoaded(event:Event):void
{
personageQuotes_XML = new XML(xmlLoader.data);
var quote:String = personageQuotes_XML.personage[0].fragment.quote[0];
myText.wordWrap = true;
myText.multiline = true;
myText.text = quote;
}
Problem is that it doesn't read the line break. Instead it puts this in the textfield:
'This is a text.\n This line should be the second but isn't'
I've also tried with <br> </br> and <br/>, but then I only got errors about a quote tag not being properly closed etc.
How to I make line breaks / carriage returns work when reading a XML file?