Flash CS3 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > Video > height (Video.height property) | |||
public height : Number [read-only]
An integer specifying the height of the video stream, in pixels. For live streams, this value is the same as the Camera.height property of the Camera object that is capturing the video stream. For FLV files, this value is the height of the file that was exported as FLV.
You may want to use this property, for example, to ensure that the user is seeing the video at the same size at which it was captured, regardless of the actual size of the Video object on the Stage.
Availability: ActionScript 1.0; Flash Player 6
The following example sets the _height and _width properties of the Video Symbol instance equal to the height and width of the loaded FLV file.
To use this example, first create a new Video symbol with an instance name of "myVideo" and place it in the same context as this script. The height and width properties will be zero when the NetStream.Play.Start status code is triggered. By resizing the video when the status of NetStream.Buffer.Full is received you make sure that its size is correct before the first frame of video is shown.
var netConn:NetConnection = new NetConnection();
netConn.connect(null);
var netStrm:NetStream = new NetStream(netConn);
myVideo.attachVideo(netStrm);
netStrm.play("Video.flv");
netStrm.onStatus = function(infoObject:Object) {
switch (infoObject.code) {
case 'NetStream.Play.Start' :
case 'NetStream.Buffer.Full' :
myVideo._width = myVideo.width;
myVideo._height = myVideo.height;
break;
}
}
_height (MovieClip._height property), width (Video.width property)
Flash CS3