A-C > Camera.onActivity |  |

Camera.onActivity

Camera, video, event handler, Camera.onActivity, onActivity

Communications/Camera/Events/onActivity

Availability

Flash Player 6.

Usage

    activeCamera.onActivity = function(activity) {
    	// Your code 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 the `Camera.setMotionLevel` method.

Example

The following example displays `true` or `false` in the Output window when the camera starts or stops detecting motion.

    // Assumes a Video object named "myVideoObject" is on the Stage
    c = Camera.get();
    myVideoObject.attachVideo(c);
    c.setMotionLevel(10, 500);
    c.onActivity = function(mode)
    {
    	trace(mode);
    };

See also

`Camera.setMotionLevel`