Loading XML Data from External Sources : URLRequest : Network Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Network » URLRequest »

 

Loading XML Data from External Sources


 

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

  public class Main extends Sprite{
        var myXML:XML;
        var url:URLRequest = new URLRequest("http://www.your-domain.com/test.xml");
        var loader:URLLoader = new URLLoader(url);
    public function Main(){
        loader.addEventListener(Event.COMPLETE, onLoadComplete);
    }
    function onLoadComplete(event:Event):void {
       if (loader.data) {
          myXML = XML(loader.data);
       }
    }
  }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo Network
» URLRequest