:: ActionScript Text Animation -- line breaks?

I’m using the text effect I found in
ActionScript Text Animation , and the script works great.

My question is, is it possible to have line breaks? I tried adding spaces to end a line, but you’d have to wait for the script to read through the added spaces before the next line begins.

Thanks!
:cool:
-zap

Still haven’t figured it out… :frowning:

My code looks something like this:

text = text_variable01 + newline + text_variable02;

Isn’t ‘newline’ supposed to get me a carriage return?

i thought ‘/n’ makes a new line? i’m not entirely sure but i think that thing makes a new line…

make sure the textbox has HTML code checked and then use
%0D to make a new line

Thanks for the posts, guys!

But I figured it out on my own. :slight_smile:

Here are my variables. I placed a non-displaying ASCii character where I want my line breaks (Alt + 0160).

//-----frame 1-----
text = “1st line_2nd line_3rd line”;
nXstart = 20;
nYstart = 20;
_root.char._visible = false;
nLength = length(text);
nKerning = 11;
nLLength = 60;
nChars = 0;
nLNumber = 1;
nLSpace = 20;
ii = 0;

In the original code, the text breaks when the number of characters (variable named nChars) reaches the maximum line length (variable named nLLength) and reaches a space (nReturn). I just removed the 1st part of the code (that checks if the nChars reaches nLLength) and placed my non-displaying ASCii character (Alt+0160) in place of the ‘space’ in the line if(nReturn == " "). Here’s the code, I’ve commented out the parts I removed.

//-----frame 3-----
nChars++
//-----if(nChars >=nLLength) {-----
nReturn = text.substr(ii, 1);
if (nReturn == “_”) {
nLNumber = nLNumber+1;
nChars = 0;
}
//-----}-----
ii++;
char.duplicateMovieClip(“char”+ii, ii);
_root[“char”+ii].mcLetter.text = text.substr(ii-1, 1);
_root[“char”+ii]._x = nXstart+nCharsnKerning;
_root[“char”+ii]._y = nYstart+nLNumber
nLSpace;

That’s it, nothing too funky. :slight_smile:

More power to this site, you guys are really helping out a lot of developers!