title: AS3 Using variable from one function in another - not working
body: <p>Can't seem to get the value of myXML outside the function, despite being declared outside. What am I missing here? The data loads and traces correctly inside the function.</p>
  
  <pre><code>var myLoader:URLLoader = new URLLoader();
  myLoader.load(new URLRequest("flightPlannerBoard.xml"));
  
  var myXML:XML;
  
  // Check XML data fully loaded
  myLoader.addEventListener(Event.COMPLETE, processXML);
  
  function processXML(e:Event):void {
  
  myXML = new XML(e.target.data);
  //trace(myXML);
  }
  trace(myXML);
  </code></pre>