View Full Version : Create newline in a string AS3?
Hi i am currently generating some text via actionscript and i need to create a new line but dont know hoe to in as3, i tried the below without success, can any1 please help?
backwins.text = "Welcome Back " + usernme + newline + " Your Total Amount Of Wins Is: ";
flashkeith
02-02-2009, 07:38 PM
Make sure:
the_txt.multiline = true;
the_txt.height = 40; // or high enough for multiple lines to be seen
// "\n" is newline code, newline keyword doesn't exist in AS3
the_txt.text = "Hello\nWorld.";
senocular
02-04-2009, 12:25 PM
Note that there's also "\r" which is similar. In fact if you hit return in an input text field in Flash, it uses "\r".
Additionally, Windows uses "\r\n" (both) to represent a single new line in text used in that operating system. However, in Flash, that's considered two new lines. If you ever load text into Flash from a text file created on Windows and see that it has twice the spacing, that's why.
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.