Click to See Complete Forum and Search --> : double spaced dynamic text
StephenWaitkevi
11-10-2002, 09:56 AM
I am trying to get a multiline dynamic text box working. When the text is read from the file, it is displayed in the text box as double spaced.
The text file looks like:
txt1=This is line 1
This is line 2
This is line 3.
It displays in the text box as:
This is line 1
This is line 2
This is line 3
----
It displays single spaced if I mash the separate lines into one in the text file and it wraps okay too. But, I wrote the text as separate lines in the file so I could control where the linebreaks occur. Even if I did not want to control the wrapping, a text file with one very long line of text is cumbersome to work with
Any ideas? Thanks.
Bob Hartzell
11-10-2002, 10:32 AM
Send me the txt file -- bob@koolmoves.com
Bob Hartzell
11-10-2002, 12:04 PM
I don't think this is a KM problem. KM passes the file name to the flash player.
I would check the file contents in Notepad. Are there invisible control characters at the end of each line? The cursor should butt up against the last character in each line, not one or two spaces away from the last character.
OwenAus
11-10-2002, 11:00 PM
Just a thought here.
Somewhere on the Macromedia site there is some information on this. I cannot find it now, so no link. But from recollection MM recommend no linefeeds in dynamic text, as some OS (windows, for example) creates CR/LF whereas others create just a LF.
So whatever you used to create the text may have created hex 0x0A and 0x0D when ENTER was pressed, causing double spacing.
One way around might be to tell your text box to accept HTML and then use <br> in a concatenated string, eg Line one<br>Line two<br>three<br><br>New paragraph, etc.
Addendum:
Maybe replacing the linefeed with a url encoded %0A will do the trick?
StephenWaitkevi
11-11-2002, 06:21 AM
Originally posted by OwenAus
Just a thought here.
Somewhere on the Macromedia site there is some information on this. I cannot find it now, so no link. But from recollection MM recommend no linefeeds in dynamic text, as some OS (windows, for example) creates CR/LF whereas others create just a LF.
So whatever you used to create the text may have created hex 0x0A and 0x0D when ENTER was pressed, causing double spacing.
You are right. I created the file in windows notepad and it did have <cr><lf> on the lines, thus accounting for the double spaces. I imported a text file from a unix server that only has <lf> on the end, and the double spacing went away. Thanks for your help!
necromanthus
11-11-2002, 04:34 PM
a simple solution:
use Norton Commander for DOS (the editor tool):
You can set for ENTER "CR & LF" or "LF" only.
flashkit.com
Copyright WebMediaBrands Inc., All Rights Reserved.