A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: double spaced dynamic text

  1. #1
    Junior Member
    Join Date
    Nov 2002
    Posts
    4

    double spaced dynamic text

    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.

  2. #2
    Senior Member
    Join Date
    Jun 2000
    Posts
    3,512
    Send me the txt file -- [email protected]

  3. #3
    Senior Member
    Join Date
    Jun 2000
    Posts
    3,512
    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.

  4. #4
    Senior Member
    Join Date
    Jun 2001
    Posts
    289
    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?
    Last edited by OwenAus; 11-10-2002 at 11:03 PM.

  5. #5
    Junior Member
    Join Date
    Nov 2002
    Posts
    4

    problem solved - single spacing again.

    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!

  6. #6
    undead creature necromanthus's Avatar
    Join Date
    Feb 2002
    Location
    ROM
    Posts
    1,890
    a simple solution:
    use Norton Commander for DOS (the editor tool):
    You can set for ENTER "CR & LF" or "LF" only.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center