Flash Media Server Developer Documentation

Camera.onActivity()

public onActivity = function(activity:Boolean) {}

Invoked when the camera starts or stops detecting motion.

Call Camera.setMotionLevel()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).

Availability

Flash Media Server (not required); Flash Player 6.

Parameters

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

Example

The following example displays true or false in the Output panel when the camera starts or stops detecting motion:

// Assumes that a Video object named "my_video" is on the Stage. 
var active_cam:Camera = Camera.get();
my_video.attachVideo(active_cam);
active_cam.setMotionLevel(10, 500);
active_cam.onActivity = function(mode) {
    trace("The camera is detecting motion: " + mode);
    // Mode output true or false. 
}

See also

Camera.setMotionLevel()