Camera.onActivity

Availability

Flash Player 6.

Usage

active_cam.onActivity = function(activity) {
  // your statements here
}

Parameters

activity A Boolean value set to true when the camera starts detecting motion, false when it stops.

Returns

Nothing.

Description

Event handler; 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().

Example

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
my_cam = Camera.get();
myVideoObject.attachVideo(my_cam);
my_cam.setMotionLevel(10, 500);
my_cam.onActivity = function(mode)
{
  trace(mode);
}

See also

Camera.onActivity, Camera.setMotionLevel()