XML code package

package {
 import flash.display.Sprite;
 import flash.net.URLLoader;
 import flash.net.URLRequest;
 import flash.events.Event;
 import flash.xml.XMLDocument;

 public class LoadXML extends Sprite {
   private var xml:XML;
   public function LoadXML() {
     var loader:URLLoader = new URLLoader();
     loader.addEventListener(Event.COMPLETE, xmlDisplay);
     loader.load(new URLRequest("path-to-myfile.xml"));
   }

   private function xmlDisplay(e:Event):void {
     xml = new XML(e.target.data);
     trace(xml);
   }
 }

}

Easy XML with Flash

All you ned to load a xml file into flash is the below code:

var my_xml = new XML();
  my+xml.onLoad =  function(success) {
    if (success) {
      trace(this);
    }
  my_xml.load("my_document.xml");

Nest time I will show how to make an application for on-line use, as well as to how to get only parts of the xml file, it is so much easier in AS 3! Also, how to update the xml file using ColdFusion!