Macromedia flash media server 2-client-side actionscript language reference for flash media server 2 User Manual

Page of 156
102
Client-Side ActionScript Language Reference
NetStream.publish()
Availability
Flash Player 6.
Flash Communication Server MX 1.0.
Usage
public publish(name : String [, howToPublish : String] ) : Void
Parameters
name
  A string value that identifies the stream. If you pass 
false
, the publish operation 
stops. Subscribers to this stream must pass this same name when they call 
You don’t need to include a file extension for the stream name.
howToPublish
  An optional string that specifies how to publish the stream. Valid values are 
"record"
"append"
, and 
"live"
. The default value is 
"live"
.
If you pass 
"record"
 for 
howToPublish
, Flash publishes and records live data, saving the 
recorded data to a new file named 
name.
flv. The file is stored on the server in a 
subdirectory within the directory containing the server application. If the file already 
exists, it is overwritten. For more information on where recorded streams are stored, see 
the Description below.
If you pass 
"append"
 for 
howToPublish
, Flash publishes and records live data, appending 
the recorded data to a file named 
name
.flv, stored on the server in a subdirectory within 
the directory containing the server application. If no file named 
name
.flv is found, it is 
created.
If you omit this parameter or pass 
"live"
, Flash publishes live data without recording it. 
If 
name
.flv exists, it will be deleted.
Returns
Nothing.
Description
Method; sends streaming audio, video, and text messages from the client to the Flash Media 
Server, optionally recording the stream during transmission. This method is available only to 
the publisher of the specified stream.