A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: XML and Flash

  1. #1
    Member
    Join Date
    May 2004
    Posts
    47

    XML and Flash

    Hi
    I have a XML attribute that looks something like this:

    address = "Some address 22 Some postalcode 4030"

    I need to present this data in a textfield like this

    Some address 22
    Some postalcode 4030

    With newlines

    I tried to put newlines "\r" in the attrubute value,
    but that did not work

    I also tried to break the text in the XML without success, eg:

    address="Some address 22
    Some postalcode 4030"

    So now I have this solution:

    Put a | between Some address 22 and postalcode 4030
    And split the string in Flash and present it like this:

    textfield.text = address[0] + "\r" + address[1]

    Does anyone have another maybe better solution?

    Thanks in advance for tips
    best regards
    T

  2. #2
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    hi,

    Can't you change your XML?
    For example, use two attributes:
    Code:
    address = "Some address 22" postalcode = "Some postalcode 4030"
    This way you'd be only thinking about the content, not the final display.
    Isn't this what XML is about?
    Last edited by nunomira; 09-19-2004 at 10:06 PM.

  3. #3
    Senior Member
    Join Date
    Aug 2002
    Location
    Dublin, Ireland
    Posts
    1,749
    I tried to put newlines "\r" in the attrubute value,
    The newline character in Flash is "\n" and not "\r".

    However, nunomira is also correct that if you have separate data elements, it makes sense to separate them out in the XML so that you can do searches by postalcode or address (for example).

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