Recently I was writing an application for Flex which I wanted to know about client-machine’s capabilities in order to provide optimal experience on my application. After searching around, I found the Capabilities API in Action script 3. This became extremely helpful as I can know figure out a things on my client machine to make my application more client orientated. For example there was a couple of things that I needed to know such as
- What is client’s screen-resolution?
- What is client’s Operating-System (OS)?
- What is Adobe Flash runtime (Flash Player or AIR) version?
- What is system-language (English or German etc) of the machine?
- What is player type (Standalone or browser-plugin)?
- Does client have audio/video support?
- Does client support accessibility aids (screen-readers etc)?
- Does client support SSL/TLS transport?
- Is client allowed to use Microphone/Webcam (in restricted/administrated environments - corporates/institutes etc)?
Adobe Flash runtimes (Flash Player and AIR) provide Capabilities API to know all these (above and more) about client-machine. You can use various static properties to determine various capabilities of client machine. Here’s an example of the outputs the values found in the flash.system.Capabilities object using several calls to trace().
package { import flash.display.Sprite; import flash.system.Capabilities; public class CapabilitiesExample extends Sprite { public function CapabilitiesExample() { showCapabilities(); } private function showCapabilities():void { trace("avHardwareDisable: " + Capabilities.avHardwareDisable); trace("hasAccessibility: " + Capabilities.hasAccessibility); trace("hasAudio: " + Capabilities.hasAudio); trace("hasAudioEncoder: " + Capabilities.hasAudioEncoder); trace("hasEmbeddedVideo: " + Capabilities.hasEmbeddedVideo); trace("hasMP3: " + Capabilities.hasMP3); trace("hasPrinting: " + Capabilities.hasPrinting); trace("hasScreenBroadcast: " + Capabilities.hasScreenBroadcast); trace("hasScreenPlayback: " + Capabilities.hasScreenPlayback); trace("hasStreamingAudio: " + Capabilities.hasStreamingAudio); trace("hasVideoEncoder: " + Capabilities.hasVideoEncoder); trace("isDebugger: " + Capabilities.isDebugger); trace("language: " + Capabilities.language); trace("localFileReadDisable: " + Capabilities.localFileReadDisable); trace("manufacturer: " + Capabilities.manufacturer); trace("os: " + Capabilities.os); trace("pixelAspectRatio: " + Capabilities.pixelAspectRatio); trace("playerType: " + Capabilities.playerType); trace("screenColor: " + Capabilities.screenColor); trace("screenDPI: " + Capabilities.screenDPI); trace("screenResolutionX: " + Capabilities.screenResolutionX); trace("screenResolutionY: " + Capabilities.screenResolutionY); trace("serverString: " + Capabilities.serverString); trace("version: " + Capabilities.version); } } }






