home *** CD-ROM | disk | FTP | other *** search
/ i·claim - visualizing argument / ICLAIM.ISO / pc / glossary.swf / scripts / __Packages / mx / controls / streamingmedia / RTMPConnection.as < prev    next >
Encoding:
Text File  |  2005-02-24  |  1.3 KB  |  44 lines

  1. class mx.controls.streamingmedia.RTMPConnection extends NetConnection
  2. {
  3.    var _player;
  4.    var _targetURI;
  5.    var _streamName;
  6.    static var _connectFlag;
  7.    static var _connectorQueue = new Array();
  8.    function RTMPConnection(player)
  9.    {
  10.       super();
  11.       this._player = player;
  12.    }
  13.    function onMetaData(info)
  14.    {
  15.       this._player.setTotalTime(info.duration);
  16.    }
  17.    function connect(targetURI, streamName)
  18.    {
  19.       if(mx.controls.streamingmedia.RTMPConnection._connectFlag == true)
  20.       {
  21.          this.pushConnection(targetURI,streamName);
  22.          return undefined;
  23.       }
  24.       mx.controls.streamingmedia.RTMPConnection._connectFlag = true;
  25.       super.connect(targetURI,streamName);
  26.       this.popConnection();
  27.    }
  28.    function pushConnection(targetURI, streamName)
  29.    {
  30.       this._targetURI = targetURI;
  31.       this._streamName = streamName;
  32.       mx.controls.streamingmedia.RTMPConnection._connectorQueue.push(this);
  33.    }
  34.    function popConnection()
  35.    {
  36.       mx.controls.streamingmedia.RTMPConnection._connectFlag = false;
  37.       if(mx.controls.streamingmedia.RTMPConnection._connectorQueue.length != 0)
  38.       {
  39.          var _loc1_ = mx.controls.streamingmedia.RTMPConnection._connectorQueue.pop();
  40.          _loc1_.connect(_loc1_._targetURI,_loc1_._streamName);
  41.       }
  42.    }
  43. }
  44.