Reputation:
How can I add new line to a dynamic text in Flash using AS3
Upvotes: 7
Views: 22845
Reputation: 3358
If you want to add a newline at the top of an HTML textfield, and the source text is in an XML file, try this:
<![CDATA[<br/>
TextField text with a newline at the top (normally discarded by Flash)]]>
Upvotes: 1
Reputation:
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
Upvotes: 5
Reputation: 3254
if you want the textfield to automatically go to multiple lines set wordWrap to true and define the tf width
Upvotes: 3
Reputation: 10665
Use "\n" for a newline (or maybe <br /> if the textfield is htmltext). Make sure it is set to multiline though.
Upvotes: 6