xml loader class


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  1. package code.utils {
  2. import flash.events.Event;
  3. import flash.events.IOErrorEvent;
  4. import flash.net.URLRequest;
  5. import flash.net.URLLoader;
  6. public class LoaderXml {
  7. public static function load(url:String, completeFun:Function, errorFun:Function = null){
  8. var loadXml:URLLoader = new URLLoader();
  9. loadXml.addEventListener(Event.COMPLETE, completeFun);
  10. errorFun == null ? null : loadXml.addEventListener(IOErrorEvent.IO_ERROR, errorFun);
  11. loadXml.load(new URLRequest(url));
  12. }
  13.  
  14. }
  15.  
  16. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.