396
ActionScript classes
Calling the
Camera.names
property requires an extensive examination of the hardware, and it
may take several seconds to build the array. In most cases, you can just use the default camera.
Availability:
ActionScript 1.0; Flash Player 6
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. 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
my_video
. Then add the following ActionScript to Frame 1 of the Timeline:
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
get (Camera.get method)
,
index (Camera.index property)
,
name (Camera.name
property)
onActivity (Camera.onActivity handler)
onActivity = function(active:Boolean) {}
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.on
Activity(false)
, use
Camera.setMotionLevel()
.
Availability:
ActionScript 1.0; Flash Player 6
Parameters
active
:Boolean
- A Boolean value set to true when the camera starts detecting motion, false
when the motion stops.
NO
T
E
The correct syntax is
Camera.names
. To assign the return value to a variable, use syntax
like
cam_array = Camera.names
. To determine the name of the current camera, use
active_cam.name
.
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...