User Guide
30 Client-Side ActionScript Language Reference
Example
The following example uses a NumericStepper instance to specify the amount of compression
applied to the camera feed. Create a new video instance by selecting New Video from the
Library options menu. Add an instance to the Stage and give it the instance name
my_video.
Add a NumericStepper with the instance name
quality_nstep. Then add the following
ActionScript to Frame 1 of the Timeline:
var quality_nstep:mx.controls.NumericStepper;
var my_cam:Camera = Camera.get();
var my_video:Video;
my_video.attachVideo(my_cam);
quality_nstep.minimum = 0;
quality_nstep.maximum = 100;
quality_nstep.stepSize = 5;
quality_nstep.value = my_cam.quality;
function changeQuality() {
my_cam.setQuality(my_cam.bandwidth, quality_nstep.value);
}
quality_nstep.addEventListener("change", changeQuality);
See also
Camera.setQuality()
Camera.setKeyFrameInterval()
Availability
■ Flash Player 6.
■ Flash Media Server (not required).
Usage
public setKeyFrameInterval(keyframeInterval : Number) : Void
Parameters
keyframeInterval A numeric value that specifies which video frames are transmitted in
full (called keyframes) instead of being interpolated by the video compression algorithm. A
value of 1 means that every frame is a keyframe, a value of 3 means that every third frame is a
keyframe, and so on. Acceptable values are 1 through 48. The default value is 15.
Returns
Nothing.