Skip to main content
Known Participant
June 1, 2006
Question

inserting line breaks in dynamic text?

  • June 1, 2006
  • 5 replies
  • 945 views
We are working on a project where we do includes on an .as file and in that .as file there are variables assigned as text strings. In cases where there are no paragraph breaks everything is groovy, but when we have a variable that is assigned a text string with a paragraph break, it says that it is not terminated correctly, even though it is terminated with an ending quote.

Any ideas? We are hoping we don't have to insert a special character for every paragraph break? Do we have to? and if so, what is that special character?

Thanks!
This topic has been closed for replies.

5 replies

Inspiring
July 11, 2006
Clear as a bell. Cheers!
kglad
Community Expert
Community Expert
July 11, 2006
1. there's no difference within flash between \n (new line) and \r (carriage return). each actually performs one line feed and one carriage return (or one carraige retrun and one line feed).

2. no space is necessary. if you insert a space after either the space will appear in the next line.
kglad
Community Expert
Community Expert
June 1, 2006
you're welcome.
Known Participant
June 1, 2006
I was hoping that wasn't the case but thanks for the response.
kglad
Community Expert
Community Expert
June 1, 2006
you can't use your keyboard's enter key to assign a line/paragraph break to a string. use \n or \r in your string.
Inspiring
July 11, 2006
Just the thread I was looking for!
A couple of follow-up questions:

1. what is the difference between \n and \r?

2. are space necessary either side of the break for it to be recognised? (eg. "Here comes the new line \n This is a new line" as opposed to "Here comes the new line\nThis is a new line")

thanks as always