home *** CD-ROM | disk | FTP | other *** search
/ Computer Active 2010 August / CA08.iso / Multimedija / shufflr.air / ShufflrClient.swf / scripts / mx / messaging / events / ChannelEvent.as next >
Encoding:
Text File  |  2010-06-23  |  1.7 KB  |  55 lines

  1. package mx.messaging.events
  2. {
  3.    import flash.events.Event;
  4.    import mx.messaging.Channel;
  5.    
  6.    public class ChannelEvent extends Event
  7.    {
  8.       public static const CONNECT:String = "channelConnect";
  9.       
  10.       public static const DISCONNECT:String = "channelDisconnect";
  11.       
  12.       public var channel:Channel;
  13.       
  14.       public var connected:Boolean;
  15.       
  16.       public var reconnecting:Boolean;
  17.       
  18.       public var rejected:Boolean;
  19.       
  20.       public function ChannelEvent(param1:String, param2:Boolean = false, param3:Boolean = false, param4:Channel = null, param5:Boolean = false, param6:Boolean = false, param7:Boolean = false)
  21.       {
  22.          super(param1,param2,param3);
  23.          this.channel = param4;
  24.          this.reconnecting = param5;
  25.          this.rejected = param6;
  26.          this.connected = param7;
  27.       }
  28.       
  29.       public static function createEvent(param1:String, param2:Channel = null, param3:Boolean = false, param4:Boolean = false, param5:Boolean = false) : ChannelEvent
  30.       {
  31.          return new ChannelEvent(param1,false,false,param2,param3,param4,param5);
  32.       }
  33.       
  34.       override public function toString() : String
  35.       {
  36.          return formatToString("ChannelEvent","channelId","reconnecting","rejected","type","bubbles","cancelable","eventPhase");
  37.       }
  38.       
  39.       override public function clone() : Event
  40.       {
  41.          return new ChannelEvent(type,bubbles,cancelable,channel,reconnecting,rejected,connected);
  42.       }
  43.       
  44.       public function get channelId() : String
  45.       {
  46.          if(channel != null)
  47.          {
  48.             return channel.id;
  49.          }
  50.          return null;
  51.       }
  52.    }
  53. }
  54.  
  55.