title: Using the NetConnection Class
body: <p>I'm trying to use the NetConnection class to connect to a live video feed on an external server.  I have it set up to start playing my video when the user clicks a Play button, however, this appears in my output every time I click the Play button:</p>
  
  <p>ArgumentError: Error #2126: NetConnection object must be connected.
   at flash.net::NetStream/ctor()
   at flash.net::NetStream()
   at Over/connectLiveStream()[Over::frame2:31]</p>
  
  <p>Any ideas as to why this isn't working?  Here is the (I think relevant) code:</p>
  
  <pre><code> if (playVid.label == "Play") 
   {
    nc = new NetConnection();
        nc.objectEncoding = flash.net.ObjectEncoding.AMF0;
        nc.connect("rtmp://my.rtmp.server:1935/live/");
  
        nsPlay = new NetStream(nc);
        nsPlay.play("livestream.flv");
  
   }
  </code></pre>
  
  <p>Thanks in advance.</p>