Before a client can play audio and video from Flash Media Server, it must connect to the server. The connection request is accepted or rejected by an application instance on the server, and connection messages are sent back to the client. Once the application accepts the connection request, a connection is available to both the client and the server.
The NetConnection class connects a client to an application instance on the server. In the simplest case, you can connect by creating an instance of NetConnection and then calling the connect() method with the URI to an application instance:
var nc:NetConnection = new NetConnection();
nc.connect("rtmp://localhost/HelloServer");
Streams handle the flow of audio, video, and data over a network connection. A NetConnection object is like a pipe that streams audio, video, and data from client to server, or from server to client. Once you create the NetConnection object, you can attach one or more streams to it.
A stream can carry more than one type of content (audio, video, and data). However, a stream flows in only one direction, from server to client or client to server.