MACROMEDIA FLEX-FLEX ACTIONSCRIPT LANGUAGE Reference page 504

Actionscript language reference
Table of Contents

Advertisement

Example
The following example uses the default camera unless more than one camera is available, in which
case the user can choose which camera to set as the default camera. If only one camera is present,
then the default camera is used.
var my_video:Video;
var cam_array:Array = Camera.names;
if (cam_array.length>1) {
System.showSettings(3);
}
var my_cam:Camera = Camera.get();
my_video.attachVideo(my_cam);
See also
,
Camera.get()
Camera.onActivity
Availability
Flash Player 6.
Usage
active_cam.onActivity = function(activity:Boolean) : Void {
// your statements here
}
Parameters
A Boolean value set to
activity
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
To specify the amount of motion required to invoke
amount of time that must elapse without activity before invoking
use
Camera.setMotionLevel()
Example
The following example writes to the log file when the camera starts or stops detecting motion:
// Assumes a Video object named "myVideoObject" is on the Stage
active_cam = Camera.get();
myVideoObject.attachVideo(active_cam);
active_cam.setMotionLevel(10, 500);
active_cam.onActivity = function(mode)
{
504
Chapter 7: ActionScript for Flash
,
Camera.index
Camera.name
true
.
when the camera starts detecting motion,
activity
Camera.onActivity(true)
false
value.
and the
Camera.onActivity(false)
when
,

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flex

Table of Contents