Search code examples
flashactionscript-3

How can I add new line to a dynamic text in Flash using AS3


How can I add new line to a dynamic text in Flash using AS3


Solution

  • Actually the problem is I am reading the text from XML file, example:

    <filename>02.jpg</filename>
    <str1>Well-trained legs \n polycarbonate blends</str1>
    <str2>Secure his ski-glide</str2>
    

    "\n" and "
    " is not working so that the only solution that I found is passing the my text to this small function

    function textMan(str:String):String{
    return str.replace("\\n", "\n");}
    

    Thanks