You want to subscribe a Flash movie to audio and/or video content from a FlashCom server.
Create a net stream that uses an existing net connection to the
FlashCom server and invoke the
FlashCom audio and video are transferred between the client and
server using net streams. When a Flash movie accesses a net stream of
a FlashCom application, it is said to be
subscribed to that net stream.
NetStream class, from which you can create
net stream objects, facilitates the sending and receiving of audio
and video. You should use a net stream object to subscribe to any
audio or video content from a FlashCom server. The same code is used
to receive the stream whether that content has been previously
recorded or whether it is live. When you create a net stream object,
you must specify the net connection object (see Recipe 14.2) over which the stream should be sent.
// Create the
NetConnectionobject. myConnection = new NetConnection( ); // Call the
connect( )method to connect to an application. myConnection.connect("rtmp:/myApplication/"); // Create a net stream that uses the net connection
myConnection. subscribe_ns = new NetStream(myConnection);
Once you have created a net stream object, you can use the
NetStream.play( ) method to subscribe to any
available audio and/or video content on the server. The
play( ) method requires you to specify the name of the stream as it ...