home *** CD-ROM | disk | FTP | other *** search
/ Champak 108 / jogo-disk-108.iso / Games / Rabbit_Rivalry.swf / scripts / __Packages / smashing / keithm / Messenger.as < prev    next >
Text File  |  2010-05-15  |  807b  |  28 lines

  1. class smashing.keithm.Messenger
  2. {
  3.    function Messenger()
  4.    {
  5.    }
  6.    static function registerAddress(id, obj)
  7.    {
  8.       if(smashing.keithm.Messenger.__addresses == undefined)
  9.       {
  10.          smashing.keithm.Messenger.__addresses = {};
  11.       }
  12.       smashing.keithm.Messenger.__addresses[id] = obj;
  13.    }
  14.    static function removeAddress(id)
  15.    {
  16.       smashing.keithm.Messenger.__addresses[id] = "";
  17.    }
  18.    static function sendMessage(id, message, args)
  19.    {
  20.       if(smashing.keithm.Messenger.__addresses[id] != "" && smashing.keithm.Messenger.__addresses[id] != undefined)
  21.       {
  22.          smashing.keithm.Messenger.__addresses[id].onMessageReceived(message,args);
  23.          return undefined;
  24.       }
  25.       trace("[Messenger] Error locating message recipient " + id);
  26.    }
  27. }
  28.