public motionTimeOut : Number [read-only]
The number of milliseconds between the time the camera stops detecting motion and the time Camera.onActivity(false) is invoked. The default value is 2000 (2 seconds).
To set this value, use Camera.setMotionLevel().
Flash Media Server (not required); Flash Player 6.
In the following example, the ProgressBar instance changes its halo theme color when the activity level falls below the motion level. You can set the number of seconds for the motionTimeout property by using a NumericStepper instance. Create a new video instance by selecting New Video from the Library panel menu. Add an instance to the Stage and give it the instance name my_video. Add a Label component instance to the Stage and give it the instance name motionLevel_lbl. Add a NumericStepper component with the instance name motionTimeOut_nstep. Add a ProgressBar component with the instance name motion_pb. Then add the following code to Frame 1 of the Timeline:
var motionLevel_lbl:mx.controls.Label;
var motion_pb:mx.controls.ProgressBar;
var motionTimeOut_nstep:mx.controls.NumericStepper;
var my_cam:Camera = Camera.get();
var my_video:Video;
my_video.attachVideo(my_cam);
this.onEnterFrame = function() {
motionLevel_lbl.text = "activityLevel: "+my_cam.activityLevel;
};
motion_pb.indeterminate = true;
my_cam.onActivity = function(isActive:Boolean) {
if (isActive) {
motion_pb.setStyle("themeColor", "haloGreen");
motion_pb.label = "Motion is above "+my_cam.motionLevel;
} else {
motion_pb.setStyle("themeColor", "haloOrange");
motion_pb.label = "Motion is below "+my_cam.motionLevel;
}
};
function changeMotionTimeOut() {
my_cam.setMotionLevel(my_cam.motionLevel, motionTimeOut_nstep.value/ 1000);
}
motionTimeOut_nstep.addEventListener("change", changeMotionTimeOut);
motionTimeOut_nstep.value = my_cam.motionTimeOut/1000;