AS: Main your number one resource for actionscript!
This will teach you how to do very need costumizing stuff with flash :)
1. What will this cover?
2.How is this useful?
2.How is it done?
What will this cover?
Probing the user's system with flash, geting data like the user's system language and more!
How is this useful
Make your game in several languages and auto-set the language to what's needed!
Suit your game to black&white cell phones that support .swf!
Detect the version of flash - player and disable advanced stuff!
Treat Macintosh and Windows (Linux maybe) differently!
The actual code
the actual code is Very simple indeed, all these properties are ALL STORED FOR YOU IN VARIABLES!!!!
All you need to do to detect the current language is look at the const var System.capabilities.language
For example, on english it contains "en"
System.capabilities contains a lot of useful variables containing useful data... since macromedia did a good job describing them I'll just paste them here
Previous | Next
Flash Player 6.
You can use the System.capabilities object to determine 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 7 (188.8.131.52):
Property summary for the System.capabilities object
All properties of the System.capabilities object are read-only.
System.capabilities.avHardwareDisable Specifies whether the user’s camera and microphone are enabled or disabled.
System.capabilities.hasAccessibility Indicates whether the player is running on a system that supports communication between Flash Player and accessibility aids.
System.capabilities.hasAudio Indicates whether the player is running on a system that has audio capabilities.
System.capabilities.hasAudioEncoder Indicates whether the player is running on a system that can encode an audio stream, such as that coming from a microphone.
System.capabilities.hasEmbeddedVideo Indicates whether the player is running on a system that supports embedded video.
System.capabilities.hasMP3 Indicates whether the player is running on a system that has an MP3 decoder.
System.capabilities.hasPrinting Indicates whether the player is running on a system that supports printing.
System.capabilities.hasScreenBroadcast Indicates whether the player supports the development of screen broadcast applications to be run through the Flash Communication Server.
System.capabilities.hasScreenPlayback Indicates whether the player supports the playback of screen broadcast applications that are being run through the Flash Communication Server.
System.capabilities.hasStreamingAudio Indicates whether the player can play streaming audio.
System.capabilities.hasStreamingVideo Indicates whether the player can play streaming video.
System.capabilities.hasVideoEncoder Indicates whether the player can encode a video stream, such as that coming from a web camera.
System.capabilities.isDebugger Indicates whether the player is an officially released version or a special debugging version.
System.capabilities.language Indicates the language of the system on which the player is running.
System.capabilities.localFileReadDisable Specifies whether the player will attempt to read anything (including the first SWF file the player launches with) from the user’s hard disk.
System.capabilities.manufacturer Indicates the manufacturer of Flash Player.
System.capabilities.os Indicates the operating system hosting Flash Player.
System.capabilities.pixelAspectRatio Indicates the pixel aspect ratio of the screen.
System.capabilities.playerType Indicates the type of player: stand-alone, external, plug-in, or ActiveX.
System.capabilities.screenColor Indicates whether the screen is color, grayscale, or black and white.
System.capabilities.screenDPI Indicates the dots-per-inch screen resolution, in pixels.
System.capabilities.screenResolutionX Indicates the horizontal size of the screen.
System.capabilities.screenResolutionY Indicates the vertical size of the screen.
System.capabilities.serverString A URL-encoded string that specifies values for each System.capabilities property.
System.capabilities.version A string containing Flash Player version and platform information.
hope you find this useful! I did!