Camera.motionTimeOut
Availability
Flash Player 6.
Usage
active_cam.motionTimeOut:Number
Description
Read-only property; the number of milliseconds between the time the camera stops detecting
motion and the time
(2 seconds).
To set this value, use
Example
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
property using a NumericStepper instance. Create a new video instance by selecting New Video
from the Library options menu. Add an instance to the Stage and give it the instance name
. Add a Label component instance to the Stage and give it the instance name
my_video
motionLevel_lbl
ProgressBar with the instance name
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;
Camera.onActivity(false)
Camera.setMotionLevel()
, a NumericStepper with the instance name
motion_pb
is invoked. The default value is 2000
.
motionTimeOut_nstep,
. Then add the following ActionScript to Frame 1
Camera.motionTimeOut
motionTimeout
and a
185
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?