home *** CD-ROM | disk | FTP | other *** search
/ Champak 50 / Volume 50 - JOGO DISK .iso / Games / mallcrawl.swf / scripts / __Packages / mx / transitions / BroadcasterMX.as next >
Encoding:
Text File  |  2007-09-28  |  1.6 KB  |  66 lines

  1. class mx.transitions.BroadcasterMX
  2. {
  3.    var _listeners;
  4.    static var version = "1.1.0.52";
  5.    function BroadcasterMX()
  6.    {
  7.    }
  8.    static function initialize(o, dontCreateArray)
  9.    {
  10.       if(o.broadcastMessage != undefined)
  11.       {
  12.          delete o.broadcastMessage;
  13.       }
  14.       o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
  15.       o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
  16.       if(!dontCreateArray)
  17.       {
  18.          o._listeners = new Array();
  19.       }
  20.    }
  21.    function addListener(o)
  22.    {
  23.       this.removeListener(o);
  24.       if(this.broadcastMessage == undefined)
  25.       {
  26.          this.broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
  27.       }
  28.       return this._listeners.push(o);
  29.    }
  30.    function removeListener(o)
  31.    {
  32.       var _loc2_ = this._listeners;
  33.       var _loc3_ = _loc2_.length;
  34.       while(true)
  35.       {
  36.          _loc3_;
  37.          if(!_loc3_--)
  38.          {
  39.             break;
  40.          }
  41.          if(_loc2_[_loc3_] == o)
  42.          {
  43.             _loc2_.splice(_loc3_,1);
  44.             if(!_loc2_.length)
  45.             {
  46.                this.broadcastMessage = undefined;
  47.             }
  48.             return true;
  49.          }
  50.       }
  51.       return false;
  52.    }
  53.    function broadcastMessage()
  54.    {
  55.       var _loc5_ = String(arguments.shift());
  56.       var _loc4_ = this._listeners.concat();
  57.       var _loc6_ = _loc4_.length;
  58.       var _loc3_ = 0;
  59.       while(_loc3_ < _loc6_)
  60.       {
  61.          _loc4_[_loc3_][_loc5_].apply(_loc4_[_loc3_],arguments);
  62.          _loc3_ = _loc3_ + 1;
  63.       }
  64.    }
  65. }
  66.