3 Replies Latest reply on Feb 2, 2007 11:39 AM by Peter Lorent

    Load XML Values into an array


      I am having problems loading XML values into an array, here is my code:

      var budgetImpactValues:Array = new Array();
      var myXML:XML = new XML();
      myXML.ignoreWhite = true;
      myXML.onLoad = function(success) {
      if (success) {
      } else {
      // error

      function importData() {
      for (n=0; n<myXML.firstChild.childNodes.length; n++) {
      var value = myXML.firstChild.childNodes[n].firstChild.nodeValue;
      budgetImpactValues[n] = value;

      When I attempt to do a trace on budgetImpactValues, I get undefined, however if I do the trace from within the function the values are there, can anyone see what I am doing wrong here please?

      Thanks for your advice