PDA

View Full Version : dynamic text question about line breaks


Flash Gordon
03-29-2005, 05:26 AM
the text loads fine without any problems. But to get the line break (without waiting for the "wrap around") i have to use a hard return in my .txt file. However, flash interprets this as 2 lines breaks and my swf txt looks like so:

Here it the first line

Here is the second line

However my .txt looks like this:

Here is the first line
Here is the second line

How should i get around this? thanks.

williamon9
03-29-2005, 06:33 AM
try to turn html text on, and then change your text to:

Here is the first line<br>Here is the second line

would this help?

merlinvicki
03-29-2005, 02:15 PM
hi,
use "\n" for line breaks wherever u want them when u r calling text from flash itself.
like:

Here it the first line + "\n" + Here is the second line

otherwise when calling external text use as Jordon says...
NB. u can specify the height of the <br> tag via external css if u still dont like the spacing.

Flash Gordon
03-30-2005, 01:21 AM
thank you guys. that's similar to perl with the \n's.

Flash Gordon
03-30-2005, 03:40 AM
I just tested the code and the \n doesn't work.
Also, I turned on <html> and the <br> didn't work either.
what gives?
Line of text one
Line of text two
Could you format this for me correctly?

tg
03-30-2005, 04:51 AM
flash uses \n (new line) and \r (return) .... i think thats what they represent.

if you are using a formated text file to read in, your may want to strip out one or both, or use an unformatted file with html.

Flash Gordon
03-30-2005, 05:02 AM
if you are using a formated text file to read in, your may want to strip out one or both, or use an unformatted file with html.
I appreciate your help, but what you just said is WAY over my head. sorry :(

ShaolinWood
12-07-2005, 12:34 PM
I'm having a similar problem, I'm using loadVariables() to load various variables and their values from a php file that spits out a row of text that looks like this:
&option0=blah+blah+blah&option1=blah+blah+blah

And I want to add linebreaks inside the values (the blah blahs) because those details will be things like addresses and phone numbers.

It should be something like:

Contact Numbers:
Tel: 994 8 84894
Fax: 048 3038 038

but I can't get Flash to read ANY of the <br> <BR> <p></p> \n etc
It just adds it into the copy...

Any advice?
Should I use a different loading action?

ShaolinWood
12-07-2005, 02:14 PM
OK, it was something stupid at the end.
Instead of using:

myTextfield.text = "text with HTML tags";

You should use:

myTextfield.htmlText = "text with HTML tags";

Then it all works so much easier :)

Syllogism
08-04-2006, 06:08 PM
In addition to this you should also make sure and set the textfield's html property to true. either by putting in

my_txt.html = true;

in actionscript or just clicking the html button for the textfield.