home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Esportes / CrossingCup.swf / scripts / __Packages / EventCenter.as < prev    next >
Text File  |  2007-12-11  |  945b  |  38 lines

  1. class EventCenter
  2. {
  3.    function EventCenter()
  4.    {
  5.       this._eventSource = {};
  6.       mx.events.EventDispatcher.initialize(this._eventSource);
  7.    }
  8.    static function access()
  9.    {
  10.       if(EventCenter._instance == undefined)
  11.       {
  12.          EventCenter._instance = new EventCenter();
  13.       }
  14.       return EventCenter._instance;
  15.    }
  16.    function addEventListener(type, listener)
  17.    {
  18.       this._eventSource.addEventListener(type,listener);
  19.    }
  20.    function removeEventListener(type, listener)
  21.    {
  22.       this._eventSource.removeEventListener(type,listener);
  23.    }
  24.    function dispatchEvent(event)
  25.    {
  26.       this._eventSource.dispatchEvent(event);
  27.    }
  28.    function _dispatchEvent(event)
  29.    {
  30.       this._eventSource.dispatchEvent(event);
  31.    }
  32.    function broadcast(_type, _target, _data)
  33.    {
  34.       var _loc2_ = {type:_type,target:_target,data:_data};
  35.       this._eventSource.dispatchEvent(_loc2_);
  36.    }
  37. }
  38.