views:

902

answers:

3

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

A: 

Use "\n" for a newline (or maybe <br /> if the textfield is htmltext). Make sure it is set to multiline though.

Simon Groenewolt
A: 

if you want the textfield to automatically go to multiple lines set wordWrap to true and define the tf width

Oliver
A: 

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

Zajil