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.

Specifies a video stream (source) to be displayed within the boundaries of the Video object on<br />

the Stage. The video stream is either an FLV file being displayed by means of the<br />

NetStream.play() comm<strong>and</strong>, or null. If source is null, video is no longer played within the<br />

Video object.<br />

You don't have to use this method if the FLV file contains only audio; the audio portion of<br />

FLV files is played automatically when the NetStream.play() comm<strong>and</strong> is issued.<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 />

Availability<br />

ActionScript 1.0; Flash Player 6 - The ability to work with Flash Video (FLV) files was added<br />

in Flash Player 7.<br />

Example<br />

The following example plays a previously recorded file named video1.flv that is stored in the<br />

same directory as the SWF file.<br />

var my_video:Video; // my_video is a Video object on the Stage<br />

var my_nc:NetConnection = new NetConnection();<br />

my_nc.connect(null);<br />

var my_ns:NetStream = new NetStream(my_nc);<br />

my_video.attachVideo(my_ns);<br />

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

See also<br />

play (Video.play method), stop (Video.stop method), resume (Video.resume<br />

method)<br />

close (Video.close method)<br />

public close() : Void<br />

Stops playback of the video, frees the memory associated with this Video object, <strong>and</strong> clears the<br />

video area onscreen.<br />

Example<br />

The following example closes the video that is playing in a Video object named video1.<br />

video1.close()<br />

672 ActionScript classes

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

Saved successfully!

Ooh no, something went wrong!