dcsimg
A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Parsing XML from XMLSocket

  1. #1
    Junior Member
    Join Date
    Jan 2003
    Posts
    6

    Parsing XML from XMLSocket

    Hi. I am working with a movie that receives data from an XML socket. The socket server is written in vb.net I have it working fine and am able to parse the data in my action script.

    My problem is the actions script I am using is a little clunky. I have a strong feeling there is a better way. I have a FlashMX actionscripting book that shows some stuff that looks like it could be much more beneficial.

    This works for me:

    function xmlReceived(doc) {
    trace(doc);
    }

    server = new XMLSocket();
    server.connect("127.0.0.1", 50000)
    server.onXML = xmlReceived;

    But then how do I get to:

    trace(myXML.firstChild.firstChild);

    I don't know how to tie the two together.

    Thanks.

  2. #2
    Junior Member
    Join Date
    Jan 2003
    Posts
    6

    :***********(

    :***********(

  3. #3
    Senior Member
    Join Date
    Feb 2001
    Location
    Provo, Utah
    Posts
    1,112
    The parameter 'doc' that you use in your xmlRecieved function will hold the parsed XML Object... if I remember correctly - it's been a while.
    Richard Lyman
    rich at lithinos.com
    www.lithinos.com

  4. #4
    Junior Member
    Join Date
    Jan 2003
    Posts
    6
    That doesn't help me very much. I need syntax.

  5. #5
    Senior Member
    Join Date
    Feb 2001
    Location
    Provo, Utah
    Posts
    1,112
    Richard Lyman
    rich at lithinos.com
    www.lithinos.com

  6. #6
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    The syntax would be:

    trace(doc.firstChild.firstChild);

    Thanks
    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