03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Parameters<br />

flag:Boolean [optional] - A Boolean value specifying whether to pause play (true) or<br />

resume play (false). If you omit this parameter, NetStream.pause() acts as a toggle: the<br />

first time it is called on a specified stream, it pauses play, <strong>and</strong> the next time it is called, it<br />

resumes play.<br />

Example<br />

The following examples illustrate some uses of this method:<br />

my_ns.pause(); // pauses play first time issued<br />

my_ns.pause(); // resumes play<br />

my_ns.pause(false); // no effect, play continues<br />

my_ns.pause(); // pauses play<br />

See also<br />

close (NetStream.close method), play (NetStream.play method)<br />

play (NetStream.play method)<br />

public play(name:Object, start:Number, len:Number, reset:Object) : Void<br />

Begins playback of an external video (FLV) file. To view video data, you must call a<br />

Video.attachVideo() method; audio being streamed with the video, or an FLV file that<br />

contains only audio, is played automatically.<br />

If you want to control the audio associated with an FLV file, you can use<br />

MovieClip.attachAudio() to route the audio to a movie clip; you can then create a Sound<br />

object to control some aspects of the audio. For more information, see<br />

MovieClip.attachAudio().<br />

If the FLV file can't be found, the NetStream.onStatus event h<strong>and</strong>ler is invoked. If you<br />

want to stop a stream that is currently playing, use NetStream.close().<br />

You can play local FLV files that are stored in the same directory as the SWF file or in a<br />

subdirectory; you can't navigate to a higher-level directory. For example, if the SWF file is<br />

located in a directory named /training, <strong>and</strong> you want to play a video stored in the /training/<br />

videos directory, you would use the following syntax:<br />

my_ns.play("videos/videoName.flv");<br />

To play a video stored in the /training directory, you would use the following syntax:<br />

my_ns.play("videoName.flv");<br />

When using this method, consider the Flash Player security model.<br />

For Flash Player 8:<br />

994 <strong>ActionScript</strong> classes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!