User Guide
388 ActionScript classes
When a SWF file tries to access the camera returned by Camera.get(), Flash Player displays a
Privacy dialog box that lets the user choose whether to allow or deny access to the camera.
(Make sure your Stage size is at least 215 x 138 pixels; this is the minimum size Flash requires
to display the dialog box.)
When the user responds to this dialog box, the
Camera.onStatus event handler returns an
information object that indicates the user's response. To determine whether the user has
denied or allowed access to the camera without processing this event handler, use the
Camera.muted property.
The user can also specify permanent privacy settings for a particular domain by right-clicking
(Windows) or Control-clicking (Macintosh) while a SWF file is playing, selecting Settings,
opening the Privacy panel, and selecting Remember.
You can't use ActionScript to set the Allow or Deny value for a user, but you can display the
Privacy panel for the user by using
System.showSettings(0). If the user selects Remember,
Flash Player no longer displays the Privacy dialog box for SWF files from this domain.
If
Camera.get returns null, either the camera is in use by another application, or there are no
cameras installed on the system. To determine whether any cameras are installed, use
Camera.names.length. To display the Flash Player Camera Settings panel, which lets the
user choose the camera to be referenced by
Camera.get(), use System.showSettings(3).
Scanning the hardware for cameras takes time. When Flash finds at least one camera, the
hardware is not scanned again for the lifetime of the player instance. However, if Flash doesn't
find any cameras, it will scan each time
Camera.get is called. This is helpful if a user has
forgotten to connect the camera; if your SWF file provides a Try Again button that calls
Camera.get, Flash can find the camera without the user having to restart the SWF file.
Availability: ActionScript 1.0; Flash Player 6
Parameters
index:Number [optional] - A zero-based integer that specifies which camera to get, as
determined from the array returned by the
Camera.names property. To get the default camera
(which is recommended for most applications), omit this parameter.
NOTE
The correct syntax is Camera.get(). To assign the Camera object to a variable, use syntax
like
active_cam - Camera.get().