如何使用AS3在Flash中为动态文本添加新行

7 flash actionscript-3

如何使用AS3在Flash中为动态文本添加新行

Sim*_*olt 6

使用"\n"表示换行符(如果textfield是htmltext,可以使用<br />).确保它设置为多行.


小智 5

实际问题是我正在从XML文件中读取文本,例如:

<filename>02.jpg</filename>
<str1>Well-trained legs \n polycarbonate blends</str1>
<str2>Secure his ski-glide</str2>
Run Code Online (Sandbox Code Playgroud)

"\n"和"
"不起作用,所以我找到的唯一解决方案是将我的文本传递给这个小函数

function textMan(str:String):String{
return str.replace("\\n", "\n");}
Run Code Online (Sandbox Code Playgroud)

谢谢