
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
110
Parameters
name A string indicating the name of a stream. You can use the format tag in the name parameter to specify the
type.
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.size() 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 number; if the requested stream is not found, returns 0.
Example
The following examples display the size of a stream and an MP3 stream, respectively:
function onProcessCmd(cmd){
// Insert code here...
var streamSize = Stream.size("foo");
trace("Size: " + streamSize + "\n");
}
//For mp3
function onProcessCmd(cmd){
// Insert code here...
var streamSize = Stream.size("mp3:foo" );
trace("Size: " + streamSize + "\n");
}
//For mp4
function onProcessCmd(cmd){
// Insert code here...
var streamSize = Stream.size("mp4:foo" );
trace("Size: " + streamSize + "\n");
}
Stream.syncWrite
myStream.syncWrite
A boolean value that controls when a stream writes the contents of the buffer to a file as the stream is recording.
When
syncWrite is true, all the messages that pass through the stream are flushed to the file immediately. It is
highly recommended that you set
syncWrite to true only in a stream that contains only data. Synchronization
problems may occur if
syncWrite is set to true in a stream that contains data and audio, video, or some combi-
nation.
Availability
Flash Media Server 2
Example
The following example flushes data immediately to the file:
// Assume foo is a data-only stream.
application.myStream = Stream.get("foo");
Commenti su questo manuale