1 Reply Latest reply on May 18, 2006 2:43 PM by Mr_Interweb

    XML Not Loading

    vin-E
      Should be simple. The code works up to the "success" part of the xml load. I always get a failure. No explanation. I was able to make a simlple file load the xml - not this code. I know its something simple. am I missing a semicolon?

      function loadXML(success) {
      trace("in load module");
      if (success) {
      trace("load is positive");
      xmlNode = this.firstChild;
      image = [];
      thumb = [];
      description = [];
      total = xmlNode.childNodes.length;
      for (i=0; i< total; i++) {
      image = xmlNode.childNodes.childNodes[0].firstChild.nodeValue;
      thumb = xmlNode.childNodes.childNodes[1].firstChild.nodeValue;
      description = xmlNode.childNodes.childNodes[2].firstChild.nodeValue;
      thumbclip = "mc_" + i;
      _root.gallery.thumbclip = thumb ;
      trace(thumb
      +"going into "+thumbclip);
      }
      firstImage();
      } else {
      trace("file not loaded!");
      }
      }
      function getGallery(what){
      trace(what+" is in getGallery");
      myXML.onLoad = loadXML();
      myXML.load(what)

        • 1. Re: XML Not Loading
          Mr_Interweb Level 1
          There is this really handy thing in Flash that you can use to check to see if your script is valid. It looks like a little check mark

          This is what it gave me:

          **Error** Scene=Scene 1, layer=actions, frame=2:Line 23: Statement block must be terminated by '}'
          function getGallery(what){

          AKA - you are missing a ';' at the end and a '}' for the funciton on line 23.

          **Error** Scene=Scene 1, layer=actions, frame=2:Line 27: Syntax error.

          Total ActionScript Errors: 2 Reported Errors: 2