03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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 />

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 />

NetStream.play() is not allowed if the calling SWF file is in the local-with-file-system<br />

s<strong>and</strong>box <strong>and</strong> the resource is in a non-local s<strong>and</strong>box.<br />

NetStream 511

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

Saved successfully!

Ooh no, something went wrong!