User Guide
152 Server-Side ActionScript Language Reference
length The length of play, in seconds. For a live stream, a value of -1 plays the stream as
long as the stream exists. Any positive value plays the stream for the corresponding number of
seconds. For a recorded stream, a value of -1 plays the entire file, and a value of 0 returns the
first video frame. Any positive number plays the stream for the corresponding number of
seconds. By default, the value is -1. This is an optional parameter.
reset A Boolean value, or number, that flushes the playing stream. If reset is false (0),
the server maintains a playlist, and each call to
Stream.play is appended to the end of the
playlist so that the next play does not start until the previous play finishes. You can use this
technique to create a dynamic playlist. If
reset is true (1), any playing stream stops, and the
playlist is reset. By default, the value is
true.
You can also specify a number value of
2 or 3 for the reset parameter, which is useful when
playing recorded stream files that contain message data. These values are analogous to
false
(
0) and true (1), respectively: a value of 2 maintains a playlist, and a value of 3 resets the
playlist. However, the difference is that specifying either
2 or 3 for reset returns all messages
in the specified recorded stream at once, rather than at the intervals which the messages were
originally recorded (the default behavior).
For more information on Flash Media Server logging see TechNote 16464 on the
Macromedia Flash Media Server Support Center at www.macromedia.com/support/
flashcom/ts/documents/flashcom_logging.htm.
remoteConnection A reference to a NetConnection object that is used to connect to a
remote server. The requested stream plays from the remote server if this parameter is provided.
This parameter is optional.
virtualKey A string indicating a key value. Starting with Flash Media Server 2, stream
names are not always unique; you can create multiple streams with the same name, place them
in different physical directories, and use the VirtualDirectory section and VirtualKeys section
of the vhost.xml file to direct clients to the appropriate stream. Because the
Stream.length()
method is not associated with a client, but connects to a stream on the server, you may need to
specify a virtual key to identify the correct stream. For more information about keys, see
Client.virtualKey. This parameter is optional.
Returns
A Boolean value: true if the Stream.play call is accepted by the server and added to the
playlist;
false otherwise. The Stream.play method can fail if the server fails to find the
stream or if an error occurs. To get information about the
Stream.play call, you can define a
Stream.onStatus handler to catch the play status or error.
If the
streamName parameter is false, the stream stops playing. A Boolean value of true is
returned if the stop succeeds;
false otherwise.