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

Page of 156
96
Client-Side ActionScript Language Reference
NetStream.pause()
Availability
Flash Player 6.
Flash Communication Server MX 1.0.
Usage
public pause( [ flag : Boolean] ) : Void
Parameters
flag
  Optional: a Boolean value specifying whether to pause play (
true
) or resume play 
(
false
). If you omit this parameter, 
NetStream.pause()
 acts as a toggle: the first time it is 
called on a specified stream, it pauses play, and the next time it is called, it resumes play. 
Returns
Nothing.
Description
Method; pauses or resumes playback of a stream. This method is available only to clients 
subscribed to the specified stream, not to the stream’s publisher.
The first time you call this method on a given playlist (without sending a parameter), it pauses 
the playlist; the next time, it resumes play. You might want to attach this method to a button 
that the user presses to pause or resume playback.
Example
The following examples illustrate some uses of this method.
my_ns.pause(); // pauses play first time issued
my_ns.pause(); // resumes play
my_ns.pause(false); // no effect, play continues
my_ns.pause(); // pauses play