home *** CD-ROM | disk | FTP | other *** search
/ The Complete Idiot's Guide to Microsoft Excel 2010 / CIGExcel.iso / Videos / Flash / controller.swf / scripts / __Packages / com / techsmith / utils / AbstractReader.as next >
Encoding:
Text File  |  2010-09-09  |  1.1 KB  |  51 lines

  1. class com.techsmith.utils.AbstractReader
  2. {
  3.    var reader;
  4.    var xmlObject;
  5.    function AbstractReader(s)
  6.    {
  7.       if(this.reader == undefined)
  8.       {
  9.          this.reader = this;
  10.          this.xmlObject = new XML();
  11.          this.xmlObject.ignoreWhite = true;
  12.          this.xmlObject.onLoad = com.techsmith.utils.Delegate.create(this,this.readXML);
  13.          this.xmlObject.load(s);
  14.          mx.events.EventDispatcher.initialize(this);
  15.       }
  16.       return undefined;
  17.    }
  18.    function dispatchEvent()
  19.    {
  20.    }
  21.    function addEventListener()
  22.    {
  23.    }
  24.    function removeEventListener()
  25.    {
  26.    }
  27.    function readXML(success)
  28.    {
  29.       if(success)
  30.       {
  31.          var _loc2_ = undefined;
  32.          _loc2_ = this.parse();
  33.          this.sendEvent(_loc2_);
  34.       }
  35.       else
  36.       {
  37.          trace("unable to load config file: ");
  38.          this.dispatchEvent({target:this,type:"xmlLoadError"});
  39.       }
  40.    }
  41.    function parse()
  42.    {
  43.       return this.xmlObject;
  44.    }
  45.    function sendEvent(evt)
  46.    {
  47.       this.dispatchEvent({target:this,type:"xmlLoadComplete",data:evt});
  48.       delete this.xmlObject;
  49.    }
  50. }
  51.