12 Replies Latest reply on Aug 18, 2006 2:32 PM by kglad

    XML Loading Problem - Review Code

    Steele Imaging Level 1
      Here is the structure of my FLA file for this problem:

      Screens are as follows:

      STEELEIMAGINGLTD_SCR
      -HOME_SCR
      -CLIENT_SCR
      -DEMOS_SCR
      -ABOUT_SCR
      -CONTACT_SCR
      -MENU_SCR

      On the initial load, the STEELEIMAGING_SCR contains the follow XML code to load customer data into the FLA file so that when a client selects "Client Login" from the menu screen, this data is available to process the login feature. It DOES work, however, sometimes it takes 4 or 5 refreshed of internet exlporer to get the code loaded. Once it's loaded, it works like a charm.

      [code]

      function parseXML(success) {
      if (!success)
      {
      gotoAndPlay("badload");
      return;
      }
      var customers = this.childNodes[0].childNodes;
      for (var i = 0; i<customers.length; i++)
      {
      var custLine = Array();
      custLine["compName"] = customers .attributes.compName;
      custLine["username"] = customers
      .attributes.username;
      custLine["subdir"] = customers .attributes.subdir;
      custLine["clientpage"] = customers
      .attributes.clientpage;
      custLine["contact"] = customers .attributes.contact;
      custLine["clientCategory"] = customers
      .attributes.clientCategory;
      custLine["activeContract"] = customers .attributes.activeContract;
      custLine["contractStart"] = customers
      .attributes.contractStart;
      custLine["contractEnd"] = customers .attributes.contractEnd;
      custLine["contractStatus"] = customers
      .attributes.contractStatus;
      custLine["sweeperLimit"] = customers .attributes.sweeperLimit;
      custLine["sweeperSubLimit"] = customers
      .attributes.sweeperSubLimit;
      custLine["promoLimit"] = customers .attributes.promoLimit;
      custLine["promoSubLimit"] = customers
      .attributes.promoSubLimit;
      custLine["pagesLimit"] = customers .attributes.pagesLimit;
      custLine["clientMessage"] = customers
      .attributes.clientMessage;
      _global.customers.push(custLine);
      }
      }
      _global.customers = Array();
      cust_xml = new XML();
      cust_xml.ignoreWhite = true;
      cust_xml.onLoad = parseXML;
      cust_xml.load("customer.xml");
      stop();

      [end]

      Why does the XML file not take on the initial load of the SWF in Explorer? Is the code in the wrong place? Is there an error in this code that I am not aware of? Does anyone have a suggestion?

      I will deposit $25.00 US to the PAYPAL account of the first person to CORRECTLY solve this issue.
      Thank you.
      Dave Steele