Flash Player 6; the ability to work with Flash Video (FLV) files was added in Flash Player 7.
my_video.attachVideo(source:Object): Void
source A Camera object that is capturing video data or a NetStream object. To drop the connection to the Video object, pass null for source.
Nothing.
Method; specifies a video stream (source) to be displayed within the boundaries of the Video object on the Stage. The video stream is either an FLV file being displayed by means of the NetStream.play() command, a Camera object, or null. If source is null, video is no longer played within the Video object.
You don't have to use this method if the FLV file contains only audio; the audio portion of an FLV files is played automatically when the NetStream.play() command is issued.
If you want to control the audio associated with an FLV file, you can use MovieClip.attachAudio() to route the audio to a movie clip; you can then create a Sound object to control some aspects of the audio. For more information, see MovieClip.attachAudio().
The following example plays live video locally:
var my_video:Video; //my_video is a Video object on the Stage var active_cam:Camera = Camera.get(); my_video.attachVideo(active_cam);
The following example plays a previously recorded file named myVideo.flv that is stored in the same directory as the SWF file.
var my_video:Video; // my_video is a Video object on the Stage
var my_nc:NetConnection = new NetConnection();
my_nc.connect(null);
var my_ns:NetStream = new NetStream(my_nc);
my_video.attachVideo(my_ns);
my_ns.play("video1.flv");
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/mx2004/main_7_2/00001873.html
Comments
_Maulik said on Jul 22, 2005 at 3:51 AM : ali mills said on Jul 22, 2005 at 8:44 AM : amjad-ghost said on Sep 1, 2005 at 3:08 AM : John Whittington said on Mar 9, 2006 at 2:19 PM :