Adobe FLEX 2-PROGRAMMING ACTIONSCRIPT 3.0 Manual page 186

Programming actionscript 3.0
Table of Contents

Advertisement

Working with video
The Video class is not in the flash.display package, but it is a subclass of the DisplayObject
class. To have a video attached to the Video object, you must use the
method or the
attachCamera()
Here is a simple example that attaches a net stream to a video and adds the video to the Sprite
display object container:
import flash.display.Sprite;
import flash.net.*;
import flash.media.Video;
public class VideoTest extends Sprite
{
private var videoUrl:String = "http://example.com/test.flv";
public function VideoTest()
{
var connection:NetConnection = new NetConnection();
connection.connect(null);
var stream:NetStream = new NetStream(connection);
var myVideo:Video = new Video(360, 240);
myVideo.attachNetStream(stream);
stream.play(videoUrl);
addChild(myVideo);
}
}
For more information, see the Video class in the ActionScript 3.0 Language Reference.
186
Display Programming
method.
attachNetStream()

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex

Table of Contents