Loading XML Data : URLRequest : Network Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Network » URLRequest »

 

Loading XML Data


 
package {
  import flash.display.*;
  import flash.events.*;
  import flash.net.*;

  public class XMLLoader extends Sprite {
    private var novel:XML;
    private var urlLoader:URLLoader;

    public function XMLLoader (  ) {
      var urlRequest:URLRequest = new URLRequest("novel.xml");
      urlLoader = new URLLoader(  );
      urlLoader.addEventListener(Event.COMPLETE, completeListener);
      urlLoader.load(urlRequest);
    }

    private function completeListener(e:Event):void {
      novel = new XML(urlLoader.data);
      trace(novel.toXMLString(  ));  
    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Network
» URLRequest