Flash CS3 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > Camera > onActivity (Camera.onActivity handler) | |||
onActivity = function(active:Boolean) {}
Invoked when the camera starts or stops detecting motion. If you want to respond to this event handler, you must create a function to process its activity value.
To specify the amount of motion required to invoke Camera.onActivity(true) and the amount of time that must elapse without activity before invoking Camera.onActivity(false), use Camera.setMotionLevel().
Availability: ActionScript 1.0; Flash Player 6
active:Boolean - A Boolean value set to true when the camera starts detecting motion, false when the motion stops.
The following example displays true or false in the Output panel when the camera starts or stops detecting motion:
// Assumes a Video object named "myVideoObject" is on the Stage
active_cam = Camera.get();
myVideoObject.attachVideo(active_cam);
active_cam.setMotionLevel(10, 500);
active_cam.onActivity = function(mode)
{
trace(mode);
}
setMotionLevel (Camera.setMotionLevel method)
Flash CS3