8 Replies Latest reply on Apr 24, 2008 10:11 AM by kglad

    Multiple XML documents in one SWF

    bobby2156
      Hi, i'm trying to create a mix and match clothing application using flash for a school project but am having trouble with xml documents. Using an online tutorial, i found it was quite easy to load up one xml document, example of code below.

      I thought it would be as simple as copying all the code and changing the variable names to load a second xml document but i find when i run the code, that only the last xml document in the code loads, could anyone give me any tips? Thanks

      function loadXML(loaded) {

      if (loaded) {

      xmlNode = this.firstChild;
      image = [];
      description = [];
      total = xmlNode.childNodes.length;
      for (i=0; i<total; i++) {

      image = xmlNode.childNodes.childNodes[0].firstChild.nodeValue;
      description = xmlNode.childNodes.childNodes[1].firstChild.nodeValue;

      }
      firstImage();

      } else {

      content = "file not loaded!";

      }

      }
      xmlData = new XML();
      xmlData.ignoreWhite = true;
      xmlData.onLoad = loadXML;
      xmlData.load("images.xml");