402
ActionScript classes
Example
The following example sends messages to the Output panel when video activity starts or stops.
Change the motion sensitivity value of 30 to a higher or lower number to see how different
values affect motion detection.
// Assumes a Video object named "myVideoObject" is on the Stage
active_cam = Camera.get();
x = 0;
function motion(mode) {
trace(x + ": " + mode);
x++;
}
active_cam.onActivity = function(mode) {
motion(mode);
}
active_cam.setMotionLevel(30, 500);
myVideoObject.attachVideo(active_cam);
See also
motionLevel (Camera.motionLevel property)
,
motionTimeOut
(Camera.motionTimeOut property)
,
onActivity (Camera.onActivity handler)
,
activityLevel (Camera.activityLevel property)
setQuality (Camera.setQuality method)
public setQuality([bandwidth:Number], [quality:Number]) : Void
Sets the maximum amount of bandwidth per second or the required picture quality of the
current outgoing video feed. This method is generally applicable only if you are transmitting
video using Flash Communication Server.
Use this method to specify which element of the outgoing video feed is more important to
your application--bandwidth use or picture quality.
■
To indicate that bandwidth use takes precedence, pass a value for
bandwidth
and 0 for
frameQuality
. Flash will transmit video at the highest quality possible within the
specified bandwidth. If necessary, Flash will reduce picture quality to avoid exceeding the
specified bandwidth. In general, as motion increases, quality decreases.
■
To indicate that quality takes precedence, pass 0 for
bandwidth
and a numeric value for
frameQuality
. Flash will use as much bandwidth as required to maintain the specified
quality. If necessary, Flash will reduce the frame rate to maintain picture quality. In
general, as motion increases, bandwidth use also increases.
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...