Camera.names
Availability
Flash Player 6.
Usage
Camera.names:Array
Note: The correct syntax is
cam_array = Camera.names
Description
Read-only class property; retrieves an array of strings reflecting the names of all available cameras
without displaying the Flash Player Privacy Settings panel. This array behaves in the same way as
any other ActionScript array, implicitly providing the zero-based index of each camera and the
number of cameras on the system (by means of
see the
Array class
Calling the
Camera.names
may take several seconds to build the array. In most cases, you can just use the default camera.
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
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
Camera.get(), Camera.index,
. To assign the return value to a variable, use syntax like
Camera.names
. To determine the name of the current camera, use
entry.
property requires an extensive examination of the hardware, and it
Camera.name
Camera.names.length
.
active_cam.name
). For more information,
.
my_video
Camera.names
189
Need help?
Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?
Questions and answers