Flash Media Server |
|||
| Client-Side ActionScript Language Reference for Flash Media Server 2 > Client-Side ActionScript Language Reference > Camera class > Camera.names | |||
public static names : Array [read-only]
|
NOTE |
|
The correct syntax is |
Class property (read-only); retrieves an array of strings reflecting the names of all available video capture devices (including video capture cards and cameras) without displaying the Flash Player Privacy dialog box. This array behaves the same as any other ActionScript array, implicitly providing the zero-based index of each camera driver and the number of camera drivers on the system (by means of Camera.names.length). For more information, see the Array class entry in the ActionScript 2.0 Language Reference.
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.
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, 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);
Camera.get(), Camera.index, Camera.names
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/fms/2/docs/00000540.html