You want to create a playlist in which streams are queued and played one after another.
NetStream.play( ) method
to add streams to the playlist. Specify
false for the
You can create playlists for net streams relatively quickly and
easily with built-in functionality. The
) method allows you to create playlists by simply
appending new streams with each subsequent
) invocation. However, the default behavior is for
play( ) to flush the current playlist. To avoid
flushing the existing playlist, specify
the optional fourth parameter,
flushPlaylists. You can use -2 and -1 as
placeholders for the intervening
length parameters to maintain the default
// Add three streams to a net stream object's playlist. mySubscribe_ns.play("stream0", -2, -1, false); mySubscribe_ns.play("stream1", -2, -1, false); mySubscribe_ns.play("stream2", -2, -1, false);
Flash automatically begins playback of the next stream in the
playlist when the current stream stops, which depends on the values
specified for the
length parameters. These parameters are
discussed in Recipe 14.7.
You can create a new playlist at any time by calling
) with a value of
true for the
flushPlaylists parameter. This flushes the
current playlist, stops the current stream, and plays the new stream.
mySubscribe_ns.play("stream3", -2, -1, true);
Omitting the fourth parameter performs the same operation: ...