capabilities (System.capabilities)


Object   |   +-System.capabilities public class capabilities extends Object

The Capabilities class determines the abilities of the system and player hosting a SWF file, which lets you tailor content for different formats. For example, the screen of a cell phone (black and white, 100 square pixels) is different than the 1000-square-pixel color PC screen. To provide appropriate content to as many users as possible, you can use the System.capabilities object to determine the type of device a user has. You can then either specify to the server to send different SWF files based on the device capabilities or tell the SWF file to alter its presentation based on the capabilities of the device.

You can send capabilities information using a GET or POST HTTP method. The following example shows a server string for a computer that has MP3 support, 1600 x 1200 pixel resolution, is running Windows XP, and Flash Player 8 (8.0.0.0):

A=t&SA=t&SV=t&EV=t&MP3=t&AE=t&VE=t&ACC=f&PR=t&SP=t& SB=f&DEB=t&V=WIN%208%2C0%2C0%2C0&M=Macromedia%20Windows& R=1600x1200&DP=72&COL=color&AR=1.0&OS=Windows%20XP& L=en&PT=External&AVD=f&LFD=f&WD=f"

All properties of the System.capabilities object are read-only.

Availability: ActionScript 1.0; Flash Player 6

Property summary

Modifiers

Property

Description

static

avHardwareDisable:Boolean [read-only]

A Boolean value that specifies whether access to the user's camera and microphone has been administratively prohibited (true) or allowed (false).

static

hasAccessibility:Boolean [read-only]

A Boolean value that is TRue if the player is running in an environment that supports communication between Flash Player and accessibility aids; false otherwise.

static

hasAudio:Boolean [read-only]

Specifies if the system has audio capabilities.

static

hasAudioEncoder:Boolean [read-only]

Specifies if the Flash Player can encode an audio stream.

static

hasEmbeddedVideo:Boolean [read-only]

A Boolean value that is true if the player is running on a system that supports embedded video; false otherwise.

static

hasIME:Boolean [read-only]

Indicates whether the system has an input method editor (IME) installed.

static

hasMP3:Boolean [read-only]

Specifies if the system has a MP3 decoder.

static

hasPrinting:Boolean [read-only]

A Boolean value that is TRue if the player is running on a system that supports printing; false otherwise.

static

hasScreenBroadcast:Boolean [read-only]

A Boolean value that is TRue if the player supports the development of screen broadcast applications to be run through the Flash Communication Server; false otherwise.

static

hasScreenPlayback:Boolean [read-only]

A Boolean value that is true if the player supports the playback of screen broadcast applications that are being run through the Flash Communication Server; false otherwise.

static

hasStreamingAudio:Boolean [read-only]

A Boolean value that is TRue if the player can play streaming audio; false otherwise.

static

hasStreamingVideo:Boolean [read-only]

A Boolean value that is TRue if the player can play streaming video; false otherwise.

static

hasVideoEncoder:Boolean [read-only]

Specifies if the Flash Player can encode a video stream.

static

isDebugger:Boolean [read-only]

A Boolean value that indicates whether the player is an officially released version (false) or a special debugging version (true).

static

language:String [read-only]

Indicates the language of the system on which the player is running.

static

localFileReadDisable:Boolean [read-only]

A Boolean value that indicates whether read access to the user's hard disk has been administratively prohibited (true) or allowed (false).

static

manufacturer:String [read-only]

A string that indicates the manufacturer of Flash Player, in the format "Macromedia OSName" (OSName could be "Windows", "Macintosh", "Linux", or "Other OS Name").

static

os:String [read-only]

A string that indicates the current operating system.

static

pixelAspectRatio:Number [read-only]

An integer that indicates the pixel aspect ratio of the screen.

static

playerType:String [read-only]

A string that indicates the type of player.

static

screenColor:String [read-only]

A string that indicates the screen color.

static

screenDPI:Number [read-only]

A number that indicates the dots-per-inch (dpi) resolution of the screen, in pixels.

static

screenResolutionX:Number [read-only]

An integer that indicates the maximum horizontal resolution of the screen.

static

screenResolutionY:Number [read-only]

An integer that indicates the maximum vertical resolution of the screen.

static

serverString:String [read-only]

A URL-encoded string that specifies values for each System.capabilities property.

static

version:String [read-only]

A string containing the Flash Player platform and version information (for example, "WIN 8,0,0,0").


Properties inherited from class Object

constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)


Method summary

Methods inherited from class Object

addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)


avHardwareDisable (capabilities.avHardwareDisable property)

public static avHardwareDisable : Boolean [read-only]

A Boolean value that specifies whether access to the user's camera and microphone has been administratively prohibited (TRue) or allowed (false). The server string is AVD.

Availability: ActionScript 1.0; Flash Player 7

Example

The following example traces the value of this read-only property:

trace(System.capabilities.avHardwareDisable);

See also

get (Camera.get method), get (Microphone.get method), showSettings (System.showSettings method)

hasAccessibility (capabilities.hasAccessibility property)

public static hasAccessibility : Boolean [read-only]

A Boolean value that is true if the player is running in an environment that supports communication between Flash Player and accessibility aids; false otherwise. The server string is ACC.

Availability: ActionScript 1.0; Flash Player 6

Example

The following example traces the value of this read-only property:

trace(System.capabilities.hasAccessibility);

See also

isActive (Accessibility.isActive method), updateProperties (Accessibility.updateProperties method),

hasAudio (capabilities.hasAudio property)

public static hasAudio : Boolean [read-only]

Specifies if the system has audio capabilities. A Boolean value that is true if the player is running on a system that has audio capabilities; false otherwise. The server string is A.

Availability: ActionScript 1.0; Flash Player 6

Example

The following example traces the value of this read-only property:

trace(System.capabilities.hasAudio);

hasAudioEncoder (capabilities.hasAudioEncoder property)

public static hasAudioEncoder : Boolean [read-only]

Specifies if the Flash Player can encode an audio stream. A Boolean value that is true if the player can encode an audio stream, such as that coming from a microphone; false otherwise. The server string is AE.

Availability: ActionScript 1.0; Flash Player 6

Example

The following example traces the value of this read-only property:

trace(System.capabilities.hasAudioEncoder);

hasEmbeddedVideo (capabilities.hasEmbeddedVideo property)

public static hasEmbeddedVideo : Boolean [read-only]

A Boolean value that is TRue if the player is running on a system that supports embedded video; false otherwise. The server string is EV.

Availability: ActionScript 1.0; Flash Player 6,0,65,0

Example

The following example traces the value of this read-only property:

trace(System.capabilities.hasEmbeddedVideo);

hasIME (capabilities.hasIME property)

public static hasIME : Boolean [read-only]

Indicates whether the system has an input method editor (IME) installed. A value of TRue indicates that the player is running on a system that has an IME installed; a value of false indicates that no IME is installed. The server string is IME.

Availability: ActionScript 1.0; Flash Player 8

Example

The following example sets the IME to ALPHANUMERIC_FULL if the player is running on a system that has an IME installed.

if(System.capabilities.hasIME) {   trace(System.IME.getConversionMode());   System.IME.setConversionMode(System.IME.ALPHANUMERIC_FULL);   trace(System.IME.getConversionMode()); }

hasMP3 (capabilities.hasMP3 property)

public static hasMP3 : Boolean [read-only]

Specifies if the system has a MP3 decoder. A Boolean value that is true if the player is running on a system that has an MP3 decoder; false otherwise. The server string is MP3.

Availability: ActionScript 1.0; Flash Player 6

Example

The following example traces the value of this read-only property:

trace(System.capabilities.hasMP3);

hasPrinting (capabilities.hasPrinting property)

public static hasPrinting : Boolean [read-only]

A Boolean value that is TRue if the player is running on a system that supports printing; false otherwise. The server string is PR.

Availability: ActionScript 1.0; Flash Player 6,0,65,0

Example

The following example traces the value of this read-only property:

trace(System.capabilities.hasPrinting);

hasScreenBroadcast (capabilities.hasScreenBroadcast property)

public static hasScreenBroadcast : Boolean [read-only]

A Boolean value that is true if the player supports the development of screen broadcast applications to be run through the Flash Communication Server; false otherwise. The server string is SB.

Availability: ActionScript 1.0; Flash Player 6,0,79,0

Example

The following example traces the value of this read-only property:

trace(System.capabilities.hasScreenBroadcast);

hasScreenPlayback (capabilities.hasScreenPlayback property)

public static hasScreenPlayback : Boolean [read-only]

A Boolean value that is true if the player supports the playback of screen broadcast applications that are being run through the Flash Communication Server; false otherwise. The server string is SP.

Availability: ActionScript 1.0; Flash Player 6,0,79,0

Example

The following example traces the value of this read-only property:

trace(System.capabilities.hasScreenPlayback);

hasStreamingAudio (capabilities.hasStreamingAudio property)

public static hasStreamingAudio : Boolean [read-only]

A Boolean value that is TRue if the player can play streaming audio; false otherwise. The server string is SA.

Availability: ActionScript 1.0; Flash Player 6,0,65,0

Example

The following example traces the value of this read-only property:

trace(System.capabilities.hasStreamingAudio);

hasStreamingVideo (capabilities.hasStreamingVideo property)

public static hasStreamingVideo : Boolean [read-only]

A Boolean value that is TRue if the player can play streaming video; false otherwise. The server string is SV.

Availability: ActionScript 1.0; Flash Player 6,0,65,0

Example

The following example traces the value of this read-only property:

trace(System.capabilities.hasStreamingVideo);

hasVideoEncoder (capabilities.hasVideoEncoder property)

public static hasVideoEncoder : Boolean [read-only]

Specifies if the Flash Player can encode a video stream. A Boolean value that is TRue if the player can encode a video stream, such as that coming from a web camera; false otherwise. The server string is VE.

Availability: ActionScript 1.0; Flash Player 6

Example

The following example traces the value of this read-only property:

trace(System.capabilities.hasVideoEncoder);

isDebugger (capabilities.isDebugger property)

public static isDebugger : Boolean [read-only]

A Boolean value that indicates whether the player is an officially released version (false) or a special debugging version (true). The server string is DEB.

Availability: ActionScript 1.0; Flash Player 6

Example

The following example traces the value of this read-only property:

trace(System.capabilities.isDebugger);

language (capabilities.language property)

public static language : String [read-only]

Indicates the language of the system on which the player is running. This property is specified as a lowercase two-letter language code from ISO 639-1. For Chinese, an additional uppercase two-letter country code subtag from ISO 3166 distinguishes between Simplified and Traditional Chinese. The languages themselves are named with the English tags. For example, fr specifies French.

This property changed in two ways for Flash Player 7. First, the language code for English systems no longer includes the country code. In Flash Player 6, all English systems return the language code and the two-letter country code subtag (en-US). In Flash Player 7, English systems return only the language code (en). Second, on Microsoft Windows systems this property now returns the User Interface (UI) Language. In Flash Player 6 on the Microsoft Windows platform, System.capabilities.language returns the User Locale, which controls settings for formatting dates, times, currency and large numbers. In Flash Player 7 on the Microsoft Windows platform, this property now returns the UI Language, which refers to the language used for all menus, dialog boxes, error messages and help files. The following table lists the possible values:

Language

Tag

Czech

cs

Danish

da

Dutch

nl

English

en

Finnish

fi

French

fr

German

de

Hungarian

hu

Italian

it

Japanese

ja

Korean

ko

Norwegian

no

Other/unknown

xu

Polish

pl

Portuguese

pt

Russian

ru

Simplified Chinese

zh-CN

Spanish

es

Swedish

sv

Traditional Chinese

zh-TW

Turkish

tr


Availability: ActionScript 1.0; Flash Player 6 - Behavior changed in Flash Player 7.

Example

The following example traces the value of this read-only property:

trace(System.capabilities.language);

localFileReadDisable (capabilities.localFileReadDisable property)

public static localFileReadDisable : Boolean [read-only]

A Boolean value that indicates whether read access to the user's hard disk has been administratively prohibited (true) or allowed (false). If set to true, Flash Player will be unable to read files (including the first SWF file that Flash Player launches with) from the user's hard disk. For example, attempts to read a file on the user's hard disk using XML.load(), LoadMovie(), or LoadVars.load() will fail if this property is set to true.

Reading runtime shared libraries will also be blocked if this property is set to true, but reading local shared objects is allowed without regard to the value of this property. The server string is LFD.

Availability: ActionScript 1.0; Flash Player 7

Example

The following example traces the value of this read-only property:

trace(System.capabilities.localFileReadDisable);

manufacturer (capabilities.manufacturer property)

public static manufacturer : String [read-only]

A string that indicates the manufacturer of Flash Player, in the format "Macromedia OSName" (OSName could be "Windows", "Macintosh", "Linux", or "Other OS Name"). The server string is M.

Availability: ActionScript 1.0; Flash Player 6

Example

The following example traces the value of this read-only property:

trace(System.capabilities.manufacturer);

os (capabilities.os property)

public static os : String [read-only]

A string that indicates the current operating system. The os property can return the following strings: "Windows XP", "Windows 2000", "Windows NT", "Windows 98/ME", "Windows 95", "Windows CE" (available only in Flash Player SDK, not in the desktop version), "Linux", and "MacOS". The server string is OS.

Availability: ActionScript 1.0; Flash Player 6

Example

The following example traces the value of this read-only property:

trace(System.capabilities.os);

pixelAspectRatio (capabilities.pixelAspectRatio property)

public static pixelAspectRatio : Number [read-only]

An integer that indicates the pixel aspect ratio of the screen. The server string is AR.

Availability: ActionScript 1.0; Flash Player 6

Example

The following example traces the value of this read-only property:

trace(System.capabilities.pixelAspectRatio);

playerType (capabilities.playerType property)

public static playerType : String [read-only]

A string that indicates the type of player. This property can have one of the following values:

  • "StandAlone" for the Flash StandAlone Player

  • "External" for the Flash Player version used by the external player, or test movie mode..

  • "PlugIn" for the Flash Player browser plug-in

  • "ActiveX" for the Flash Player ActiveX Control used by Microsoft Internet Explorer

The server string is PT.

Availability: ActionScript 1.0; Flash Player 7

Example

The following example traces the value of this read-only property:

trace(System.capabilities.playerType);

screenColor (capabilities.screenColor property)

public static screenColor : String [read-only]

A string that indicates the screen color. This property can have the value "color", "gray" or "bw", which represents color, grayscale, and black and white, respectively. The server string is COL.

Availability: ActionScript 1.0; Flash Player 6

Example

The following example traces the value of this read-only property:

trace(System.capabilities.screenColor);

screenDPI (capabilities.screenDPI property)

public static screenDPI : Number [read-only]

A number that indicates the dots-per-inch (dpi) resolution of the screen, in pixels. The server string is DP.

Availability: ActionScript 1.0; Flash Player 6

Example

The following example traces the value of this read-only property:

trace(System.capabilities.screenDPI);

screenResolutionX (capabilities.screenResolutionX property)

public static screenResolutionX : Number [read-only]

An integer that indicates the maximum horizontal resolution of the screen. The server string is R (which returns both the width and height of the screen).

Availability: ActionScript 1.0; Flash Player 6

Example

The following example traces the value of this read-only property:

trace(System.capabilities.screenResolutionX);

screenResolutionY (capabilities.screenResolutionY property)

public static screenResolutionY : Number [read-only]

An integer that indicates the maximum vertical resolution of the screen. The server string is R (which returns both the width and height of the screen).

Availability: ActionScript 1.0; Flash Player 6

Example

The following example traces the value of this read-only property:

trace(System.capabilities.screenResolutionY);

serverString (capabilities.serverString property)

public static serverString : String [read-only]

A URL-encoded string that specifies values for each System.capabilities property.

The following example shows a URL-encoded string:

A=t&SA=t&SV=t&EV=t&MP3=t&AE=t&VE=t&ACC=f&PR=t&SP=t&  SB=f&DEB=t&V=WIN%208%2C0%2C0%2C0&M=Macromedia%20Windows&  R=1600x1200&DP=72&COL=color&AR=1.0&OS=Windows%20XP&  L=en&PT=External&AVD=f&LFD=f&WD=f

Availability: ActionScript 1.0; Flash Player 6

Example

The following example traces the value of this read-only property:

trace(System.capabilities.serverString);

version (capabilities.version property)

public static version : String [read-only]

A string containing the Flash Player platform and version information (for example, "WIN 8,0,0,0"). The server string is V.

Availability: ActionScript 1.0; Flash Player 6

Example

The following example traces the value of this read-only property:

trace(System.capabilities.version);



ActionScript 2.0 Language Reference for Macromedia Flash 8
ActionScript 2.0 Language Reference for Macromedia Flash 8
ISBN: 0321384040
EAN: 2147483647
Year: 2004
Pages: 113

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net