NetStream is powerful for four reasons:

  • Availability of the player

  • Authoring environment

  • Synchronized message broadcasts

  • Quality

The NetConnection() object, as you read in Chapter 6, "STEP 6: ActionScript with NetConnection()," is a two-way persistent connection between the Flash player and Macromedia Flash Communication Server MX. NetStream uses the NetConnection object to send or receive a stream with the server. Multiple streams can exist over a single NetConnection, but each stream can only travel one way.

As you saw in Chapter 4, "STEP 4: "Simple Chat and Video Conferencing," the AVPresence components allowed you to send and receive at the same time. In that example, two streams were established between the Flash player and the server?one to receive and one to send. You can also send messages over the NetStream. This is how someone could "capture" a AVPresence window, and it would appear on all computers. Messaging will be discussed in Chapters 9, "STEP 9: Controller and Subscriber Applications," and 12, "Client-Side (Flash) ActionScript."

The Flash Communication Server acts as a facilitator, like a hub that connects and synchronizes Flash players together. A persistent relationship with the server is always maintained with each player until the connection is closed or disconnected. There are two methods for communication over NetConnection: streamed media and distributed data objects (SharedObjects). SharedObjects will be discussed in Chapter 8, "STEP 8: Collaboration with SharedObject()."

Streamed data can exist in three forms:

  • Video

  • Sound

  • Text (messaging)

There is also an assumed fourth form: a video with sound attached. The Flash Communication Server introduces the NetStream() object to Flash to handle streaming media feeds originating from the Flash player or from the server. The NetStream() object communicates with the server using the NetConnection() object. It connects with the server-side Stream() object.

    Part I: 10 Quick Steps for Getting Started