Macromedia flash media server 2-client-side actionscript language reference for flash media server 2 ユーザーズマニュアル
NetStream class
87
NetStream.close()
Availability
■
Flash Player 6.
■
Flash Communication Server MX 1.0.
Usage
public close() : Void
Parameters
None.
Returns
Nothing.
Description
Method; stops publishing or playing all data on the stream, sets the
property to 0, and makes the stream available for another use. This method is invoked
implicitly whenever you call
implicitly whenever you call
from a publishing stream, or
from a subscribing stream.
■
If this method is called from a publishing stream, all pending
calls on
the stream are cleared on the server; subscribers no longer receive anything that was being
published on the stream.
published on the stream.
■
If this method is called from a subscribing stream, publishing continues and other
subscribing streams may still be playing, but the subscriber can now use the stream for
another purpose.
subscribing streams may still be playing, but the subscriber can now use the stream for
another purpose.
■
To stop play on a subscribing stream without closing the stream or changing the stream
type, use
type, use
my_ns.play(false)
.
Example
The following
onDisconnect()
function closes a stream:
function onDisconnect() {
// Stops publishing the stream.
srcStream_ns.close();
srcStream_ns.close();
/* Deletes the source stream connection. With no source to play, the
destination stream also ends and can be deleted. */
my_nc.close();
destination stream also ends and can be deleted. */
my_nc.close();
}