dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: XML adds break line

  1. #1
    Junior Member
    Join Date
    Feb 2003
    Posts
    8

    XML adds break line

    Hello,

    I have an XML file that I generate in flash (using input text) then I send it to the server, and reload it back into flash. On reloading the XML file, every time I had hit return has a doubled the break line.

    Like
    This

    BECOMES

    Like

    This

    What is this? does the input text box process the return key improperly?

    Stefan

  2. #2
    Junior Member
    Join Date
    Feb 2003
    Posts
    8
    Well I found that it is definitely the XML that is adding a carriage return to each line feed. Why? How cal I elegantly handle this?? (without writing CR strip code))??

    Because as it is now each LF becomes LR CR (10 13)


    Stefan

  3. #3
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    Are you doing anything to the XML on the server side. If you are sending it to a windows box and using a routine to manipulate the XML it will be adding the CR-LF to the file.

    In flash it isn't to hard to remove the CRLF

    Simply to a split then a join:

    eg

    myArray = split(badText, 'crlf');
    goodText.text = myArray.join("\n");

    Sorry I don't know the code for crlf off the top of my head. Also there is a way to do this in 1 line of code and it is used in the code to make the links appear in this code:

    http://tupps.com/flash/examples/load.../demoText.html

    Sorry I don't have flash on me at the moment.

    Thanks

    Luke
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

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