6 Replies Latest reply on Mar 5, 2009 2:05 PM by Ned Murphy

    Problem with updating XML node count

      In my Flash movie I'm trying to navigate through a selection of clients stored in XML. Each client has a different number of projects.

      When I click a button which alters the value of [n] to switch to a different node(client), the number of subnodes(projects) never changes - it simply counts from the last node in the xml file (2 in the example below).

      How can I make this change each time a different client node is selelcted?

      Any ideas?

      total = xmlNode.childNodes.length; // No. of clients

      for (n=0; n<total; n++) {
      name [n] = xmlNode.childNodes[n].childNodes[0].firstChild.nodeValue;
      picture [n] = new Array();
      description [n] = new Array();

      subtotal = xmlNode.childNodes[n].childNodes.length; // No. of projects

      for (i=0; i<subtotal; i++) {
      picture [n]
      = xmlNode.childNodes[n].childNodes .childNodes[0].firstChild.nodeValue;
      description [n]
      = xmlNode.childNodes[n].childNodes .childNodes[1].firstChild.nodeValue;

      <name>Name 1</name>
      <description>Description for project 1a appears here</description>
      <name>Name 2</name>
      <description>Description for project 2a appears here</description>
      <description>Description for project 2b appears here</description>