home *** CD-ROM | disk | FTP | other *** search
/ One Click 21 (Special) / OC021.iso / Interface / it.dig / scripts / __Packages / mx / data / components / connclasses / RPCCall.as
Encoding:
Text File  |  2006-07-04  |  1.4 KB  |  54 lines

  1. class mx.data.components.connclasses.RPCCall extends MovieClip
  2. {
  3.    var dispatchEvent;
  4.    var results;
  5.    var multipleSimultaneousAllowed;
  6.    var refreshAndValidate;
  7.    var suppressInvalidCalls;
  8.    var callsInProgress = 0;
  9.    function RPCCall()
  10.    {
  11.       super();
  12.       mx.events.EventDispatcher.initialize(this);
  13.       mx.data.binding.ComponentMixins.initComponent(this);
  14.       this._visible = false;
  15.    }
  16.    function bumpCallsInProgress(amount)
  17.    {
  18.       this.callsInProgress += amount;
  19.       this.notifyStatus("StatusChange",{callsInProgress:this.callsInProgress});
  20.    }
  21.    function notifyStatus(code, data)
  22.    {
  23.       var _loc2_ = new Object();
  24.       _loc2_.type = "status";
  25.       _loc2_.code = code;
  26.       _loc2_.data = data;
  27.       this.dispatchEvent(_loc2_);
  28.    }
  29.    function setResult(r)
  30.    {
  31.       this.results = r;
  32.       this.dispatchEvent({type:"result"});
  33.    }
  34.    function triggerSetup(needsParams)
  35.    {
  36.       if(!this.multipleSimultaneousAllowed && this.callsInProgress > 0)
  37.       {
  38.          this.notifyStatus("CallAlreadyInProgress",this.callsInProgress);
  39.          return false;
  40.       }
  41.       this.dispatchEvent({type:"send"});
  42.       if(needsParams && !this.refreshAndValidate("params") && this.suppressInvalidCalls)
  43.       {
  44.          this.notifyStatus("InvalidParams");
  45.          return false;
  46.       }
  47.       return true;
  48.    }
  49.    function onUpdate()
  50.    {
  51.       this._visible = true;
  52.    }
  53. }
  54.