dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Display correct signs in flash using XML

  1. #1
    Junior Member
    Join Date
    Oct 2005
    Posts
    11

    Display correct signs in flash using XML

    I'm having trouble to display signs (', ", > and more) a XML file in dynamic text box of Flash. It's always showing ' value instead of ' sign even if I change it in that small XML tag.

    here's my example:

    myXML = new XML();
    myXML.parseXML("<news><desc>Nada's</desc></news>");

    var msg = myXML.firstChild.childNodes[0].firstChild;
    msg_txt2.text = _root.msg;

    Does anyone know how to make Flash displaying the right sign??

  2. #2
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    Those symbols have to be escaped in xml. It is probably more important that you show us your XML data that you are trying to display.
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

  3. #3
    Junior Member
    Join Date
    Oct 2005
    Posts
    11
    ok,

    In my small example, I got:

    myXML = new XML();
    myXML.parseXML("<news><desc>Nada's</desc></news>");

    _root.msg = myXML.firstChild.childNodes[0].firstChild;
    msg_txt2.text = _root.msg;

    msg is my dynamic text box instance name.

    That displays :

    Nada&apos;s

    When I add :

    msg_txt2.text = escape(_root.msg);
    it shows up : Nada%26apos%3Bs

    msg_txt2.text = unescape(_root.msg);
    it shows up : Nada&apos;s


    U got any ideas?? how to fix that?

  4. #4
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    unescape is what you are looking for.

    Thanks

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

  5. #5
    Junior Member
    Join Date
    Oct 2005
    Posts
    11
    nope dude even if the unescape, it won't show up the right sign.
    I figured it out, I forgot to add the .NodeValue after firstChild


    Quote Originally Posted by tupps
    unescape is what you are looking for.

    Thanks

    Luke

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