Hi, I just tested following code:
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="onComplete();">
<mx:Script>
<![CDATA[
private function onComplete():void {
var s:String = "This is a line \n This is another line.";
this.txtHolder.text = s;
}
]]>
</mx:Script>
<mx:TextArea id="txtHolder" />
</mx:WindowedApplication>
and with mx:Text
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="onComplete();">
<mx:Script>
<![CDATA[
private function onComplete():void {
var s:String = "This is a line \n This is another line.";
this.txtHolder.text = s;
}
]]>
</mx:Script>
<mx:Text id="txtHolder" />
</mx:WindowedApplication>
Both are working just fine. Maybe you're using mx:TextInput or mx:Label?