Capabilities Object | Flash 6 |
information about the Flash Player and its host system |
Indicates whether the Player supports accessibility (MSAA).
Indicates whether the Player supports audio playback.
Indicates whether the system can encode audio.
Indicates whether the Player supports MP3 sound playback.
Indicates whether the system can encode video.
The user input device for the system, such as a mouse (indicated by the word "point").
Indicates whether the Player is a debugging version.
The current language setting on the operating system.
The creator of the Player.
The operating system on which the Player is running.
The width-to-height ratio of a pixel on the screen.
The color mode supported by the screen (color, grayscale, or black and white).
The number of pixels per inch displayed by the screen.
The width of the screen, in pixels.
The height of the screen, in pixels.
All Capabilities property values, as a string of URL-encoded variables.
The Flash Player version.
The Capabilities object represents the specifications of the Flash Player and the system on which the Player is running. It is stored as a property of the System object (i.e., System.capabilities). Hence, references to Capabilities properties always start with the System object, as follows:
System.capabilities.propertyName
For example, the following code displays the screen width in the Output window:
trace(System.capabilities.screenResolutionX);
The Capabilities object is used to write code that adapts a movie to its playback environment. It applies primarily to mobile devices, such as Pocket PCs and cell phones. For example, by querying the value of hasAudio, a movie playing on a handheld device can check if the device can play audio. If hasAudio is false, the movie can provide text subtitles.
All properties of Capabilities have corresponding short-form names and values that can be used to send the client-side Player abilities to a server-side script. For example, the screenColor property's short form is COL, with possible values of "color", "gray", and "bw". The capabilities.serverString property joins all short-form property name/value pairs into a URL-encoded string suitable for transmission to a server. A server can read this information and respond by sending the appropriate movie or data for the playback environment. See capabilities.serverString for details.
For information on authoring Flash movies for devices, see:
For a list of devices that the Flash Player runs on, see:
Though the properties of Capabilities are writable, there is no practical reason to overwrite their system-assigned values. Doing so obscures the information they contain. Custom assignments to properties other than serverString are not reflected in the value of serverString.
The System object, the Stage object