A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: [RESOLVED] XML Tree question

Threaded View

  1. #5
    Senior Member
    Join Date
    Jun 2006
    Posts
    100
    thanks for the in depth, but the only part I was confused with was the " xml.firstChild.childNodes[0]childNodes[1].attributes.name;" part.


    My final code ended up as:

    code:

    function getData() {
    var x = new XML();
    x.ignoreWhite = true;

    var Name:Array = new Array();
    var id:Array = new Array();
    var url:Array = new Array();

    x.onLoad = function(){
    var Data:Array = this.firstChild.childNodes[_root.accordion.selectedIndex].childNodes;
    for(i=0;i<Data.length;i++) {
    Name.push(Data[i].attributes.name);
    id.push(Data[i].attributes.id);
    url.push(Data[i].attributes.url);
    list.addItem({label:Name[i], data:id[i]});
    window.contentPath:url[i];
    }
    }
    x.load("data.xml");
    }



    There was a minor change to the XML. Where "desc" was became "url".
    Last edited by SilverVenom; 07-22-2007 at 08:55 AM.

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