A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: XML help

  1. #1
    Member
    Join Date
    May 2004
    Posts
    47

    XML help

    Hi

    I tought I knew something about XML and Flash, I was wrong

    Can anyone tell me how to get eg. the <title> from <item>
    in this XML

    http://www.tinde.no/pl/47/property_r...+DESC&_limit=3

    I got:

    XMLObj.firstChild.firstChild.firstChild.firstChild .nodeValue

    To get the channel title, but I am not quite sure I understand why

    thanks in advance,
    best regards

    T

  2. #2
    ___________________
    Join Date
    May 2004
    Posts
    3,174
    code:
    var yourxml = new XML();
    yourxml.ignoreWhite = true;
    yourxml.load("yourxml.xml");
    yourxml.onLoad = function() {
    for (i=0; i<yourxml.childNodes.length; i++) {
    trace(yourxml.firstChild.childNodes[0].childNodes[0]);
    //with tags
    trace(yourxml.firstChild.childNodes[0].childNodes[0].childNodes);
    //without tags
    }
    };


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