Advertisement
Guest User

qsdqsdqsdqsd

a guest
Jan 2nd, 2017
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class ank.utils.rss.RSSLoader extends XML
  2. {
  3.    var _aChannels;
  4.    var _oData;
  5.    
  6.    function RSSLoader()
  7.    {
  8.       super();
  9.       mx.events.EventDispatcher.initialize(this);
  10.       this.ignoreWhite = true;
  11.       this.initialize();
  12.    }
  13.    function __get__data()
  14.    {
  15.       return this._oData;
  16.    }
  17.    function getChannels()
  18.    {
  19.       return this._aChannels;
  20.    }
  21.    function load(sUrl, oData)
  22.    {
  23.       super.load(sUrl);
  24.       this._oData = oData;
  25.    }
  26.    function initialize()
  27.    {
  28.       this._aChannels = new Array();
  29.    }
  30.    function parse()
  31.    {
  32.       this.initialize();
  33.       if(this.childNodes.length == 0)
  34.       {
  35.          return false;
  36.       }
  37.       var _loc2_ = this.firstChild;
  38.       if(_loc2_.nodeName.toLowerCase() != "rss")
  39.       {
  40.          return false;
  41.       }
  42.       var _loc3_ = _loc2_.firstChild;
  43.       while(_loc3_ != null)
  44.       {
  45.          if(_loc3_.nodeName.toLowerCase() == "channel")
  46.          {
  47.             var _loc4_ = new ank.utils.rss.RSSChannel();
  48.             if(_loc4_.parse(_loc3_))
  49.             {
  50.                this._aChannels.push(_loc4_);
  51.             }
  52.          }
  53.          _loc3_ = _loc3_.nextSibling;
  54.       }
  55.       return true;
  56.    }
  57.    function onLoad(bSuccess)
  58.    {
  59.       if(bSuccess)
  60.       {
  61.          if(this.parse())
  62.          {
  63.             this.dispatchEvent({type:"onRSSLoaded",data:this._oData});
  64.          }
  65.          else
  66.          {
  67.             this.dispatchEvent({type:"onBadRSSFile",data:this._oData});
  68.          }
  69.       }
  70.       else
  71.       {
  72.          this.dispatchEvent({type:"onRSSLoadError",data:this._oData});
  73.       }
  74.    }
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement