Client-Side Communication ActionScript > NetStream.close |
![]() ![]() ![]() |
NetStream.close
Availability
![]() |
Flash Player 6. |
![]() |
Flash Communication Server MX. |
Usage
myStream
.close()
Parameters
None.
Returns
Nothing.
Description
Method; stops publishing or playing all data on the stream, sets the NetStream.time
property to 0, and makes the stream available for another use. This method is invoked implicitly whenever you call NetStream.play
from a publishing stream, or NetStream.publish
from a subscribing stream.
![]() |
If this method is called from a publishing stream, all pending |
![]() |
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. |
![]() |
To stop play on a subscribing stream without closing the stream or changing the stream type, use |
Example
The following onDisconnect()
function closes a stream.
function onDisconnect() { // Stops publishing the stream. srcStream.close(); // Deletes the source stream connection. With no source // to play, the destination stream also ends and can be // deleted. connection.close(); }
See also
NetStream.pause
, NetStream.play
, NetStream.publish
, NetStream.time
![]() ![]() ![]() |