Be a Supporter!

AS: Costumization w/ "capabilities"

  • 2,431 Views
  • 26 Replies
New Topic Respond to this Topic
Inglor
Inglor
  • Member since: Jan. 26, 2003
  • Offline.
Forum Stats
Member
Level 17
Blank Slate
AS: Costumization w/ "capabilities" Jul. 22nd, 2005 @ 05:21 AM Reply

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

System.capabilities object
Availability
Flash Player 6.

Description
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 (7.0.19.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%207%2C0%2C19%2C
0&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"

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

Property
Description
Server string

System.capabilities.avHardwareDisable Specifies whether the user’s camera and microphone are enabled or disabled.
AVD

System.capabilities.hasAccessibility Indicates whether the player is running on a system that supports communication between Flash Player and accessibility aids.
ACC

System.capabilities.hasAudio Indicates whether the player is running on a system that has audio capabilities.
A

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.
AE

System.capabilities.hasEmbeddedVideo Indicates whether the player is running on a system that supports embedded video.
EV

System.capabilities.hasMP3 Indicates whether the player is running on a system that has an MP3 decoder.
MP3

System.capabilities.hasPrinting Indicates whether the player is running on a system that supports printing.
PR

System.capabilities.hasScreenBroadcast Indicates whether the player supports the development of screen broadcast applications to be run through the Flash Communication Server.
SB

System.capabilities.hasScreenPlayback Indicates whether the player supports the playback of screen broadcast applications that are being run through the Flash Communication Server.
SP

System.capabilities.hasStreamingAudio Indicates whether the player can play streaming audio.
SA

System.capabilities.hasStreamingVideo Indicates whether the player can play streaming video.
SV

System.capabilities.hasVideoEncoder Indicates whether the player can encode a video stream, such as that coming from a web camera.
VE

System.capabilities.isDebugger Indicates whether the player is an officially released version or a special debugging version.
DEB

System.capabilities.language Indicates the language of the system on which the player is running.
L

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.
LFD

System.capabilities.manufacturer Indicates the manufacturer of Flash Player.
M

System.capabilities.os Indicates the operating system hosting Flash Player.
OS

System.capabilities.pixelAspectRatio Indicates the pixel aspect ratio of the screen.
AR

System.capabilities.playerType Indicates the type of player: stand-alone, external, plug-in, or ActiveX.
PT

System.capabilities.screenColor Indicates whether the screen is color, grayscale, or black and white.
COL

System.capabilities.screenDPI Indicates the dots-per-inch screen resolution, in pixels.
DP

System.capabilities.screenResolutionX Indicates the horizontal size of the screen.
R

System.capabilities.screenResolutionY Indicates the vertical size of the screen.
R

System.capabilities.serverString A URL-encoded string that specifies values for each System.capabilities property.
n/a

System.capabilities.version A string containing Flash Player version and platform information.
V

hope you find this useful! I did!

Glaiel-Gamer
Glaiel-Gamer
  • Member since: Dec. 28, 2004
  • Offline.
Forum Stats
Member
Level 28
Game Developer
Response to AS: Costumization w/ "capabilities" Jul. 22nd, 2005 @ 07:10 AM Reply

At 7/22/05 05:21 AM, Inglor wrote: Make your game in several languages and auto-set the language to what's needed!

Why would I do that? Everyone should know english.

Joelasticot
Joelasticot
  • Member since: Feb. 14, 2003
  • Offline.
Forum Stats
Supporter
Level 46
Game Developer
Response to AS: Costumization w/ "capabilities" Jul. 22nd, 2005 @ 08:50 AM Reply

At 7/22/05 07:10 AM, Glaiel_Gamer wrote: Why would I do that? Everyone should know english.

It's not necessary, it's just a cool feature if you know more than one language.


ey

BBS Signature
liam
liam
  • Member since: Dec. 11, 2004
  • Offline.
Forum Stats
Member
Level 22
Blank Slate
Response to AS: Costumization w/ "capabilities" Jul. 22nd, 2005 @ 08:54 AM Reply

In the example files that you get with Flash (I went through them yesterday for the first time :P) they have an example of the language thing.

Good tute, any road.


Sup, bitches :)

BBS Signature
gorman2001
gorman2001
  • Member since: Aug. 18, 2002
  • Offline.
Forum Stats
Member
Level 14
Blank Slate
Response to AS: Costumization w/ "capabilities" Jul. 22nd, 2005 @ 09:10 AM Reply

At 7/22/05 07:10 AM, Glaiel_Gamer wrote:
At 7/22/05 05:21 AM, Inglor wrote: Make your game in several languages and auto-set the language to what's needed!
Why would I do that? Everyone should know english.

hey there's lots of stupid kids who don't understand a bit of english in Québec...


website :: hugostonge.com
my job :: we+are

Joelasticot
Joelasticot
  • Member since: Feb. 14, 2003
  • Offline.
Forum Stats
Supporter
Level 46
Game Developer
Response to AS: Costumization w/ "capabilities" Jul. 22nd, 2005 @ 09:50 AM Reply

At 7/22/05 09:10 AM, gorman2001 wrote: hey there's lots of stupid kids who don't understand a bit of english in Québec...

I definitely second that.


ey

BBS Signature
ZYX3D
ZYX3D
  • Member since: Jul. 31, 2004
  • Offline.
Forum Stats
Member
Level 21
Blank Slate
Response to AS: Costumization w/ "capabilities" Jul. 31st, 2005 @ 07:00 AM Reply

Well, most people in the world simply doesn't speak English. There are countries where learning English as a second tongue isn't the best of options (though it can seem amazing to you).

And most often, English-speakers do not know any other language. So it's good for you, we non-native English speakers from anywhere outside America can include English in our games so you can play them :)

liam
liam
  • Member since: Dec. 11, 2004
  • Offline.
Forum Stats
Member
Level 22
Blank Slate
Response to AS: Costumization w/ "capabilities" Aug. 13th, 2005 @ 08:36 AM Reply

I just made this for no reason at all, it uses System Capabilities.. and I remembered this thread, so heh.. thought I'd post it.

http://img299.images..mcapabilities6oa.swf

Your language is set to English, your computer can play music, your computer can play MP3s. You can encode audio, can print and can debug. Your Operating System is Windows XP. You are using a Screen Resolution of 1024x768 and your DPI is 72.


Sup, bitches :)

BBS Signature
Gutya-1
Gutya-1
  • Member since: Nov. 21, 2003
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to AS: Costumization w/ "capabilities" Aug. 13th, 2005 @ 11:46 AM Reply

At 8/13/05 08:36 AM, -liam- wrote: I just made this for no reason at all, it uses System Capabilities.. and I remembered this thread, so heh.. thought I'd post it.

http://img299.images..mcapabilities6oa.swf


Your language is set to English, your computer can play music, your computer can play MP3s. You can encode audio, can print and can debug. Your Operating System is Windows XP. You are using a Screen Resolution of 1024x768 and your DPI is 72.

fwe
fwe
  • Member since: Jul. 24, 2003
  • Offline.
Forum Stats
Member
Level 08
Blank Slate
Response to AS: Costumization w/ "capabilities" Aug. 13th, 2005 @ 11:50 AM Reply

Your language is set to English, your computer can play music, your computer can play MP3s. You can encode audio, can print and can debug. Your Operating System is Windows XP. You are using a Screen Resolution of 1280x1024 and your DPI is 72.


wtfbbqhax

Khao
Khao
  • Member since: Sep. 20, 2003
  • Offline.
Forum Stats
Member
Level 20
Blank Slate
Response to AS: Costumization w/ "capabilities" Aug. 13th, 2005 @ 11:54 AM Reply

At 7/22/05 07:10 AM, Glaiel_Gamer wrote:
At 7/22/05 05:21 AM, Inglor wrote: Make your game in several languages and auto-set the language to what's needed!
Why would I do that? Everyone should know english.

I know english but my comp is in french and i think it would be cool if a flash could set on french when i play it!

liam
liam
  • Member since: Dec. 11, 2004
  • Offline.
Forum Stats
Member
Level 22
Blank Slate
Response to AS: Costumization w/ "capabilities" Aug. 13th, 2005 @ 12:22 PM Reply

At 8/13/05 11:50 AM, fwe wrote: Your language is set to English, your computer can play music, your computer can play MP3s. You can encode audio, can print and can debug. Your Operating System is Windows XP. You are using a Screen Resolution of 1280x1024 and your DPI is 72.

So it works?

Thats good XD

There should be a way to see how much ram someone has and how good their processor is.. so you can set the graphics and quality accordingly, then again their is the "BEST" option.


Sup, bitches :)

BBS Signature
Khao
Khao
  • Member since: Sep. 20, 2003
  • Offline.
Forum Stats
Member
Level 20
Blank Slate
Response to AS: Costumization w/ "capabilities" Aug. 13th, 2005 @ 12:54 PM Reply

Your language is set to French, your computer can play music, your computer can play MP3s. You can encode audio, can print and can debug. Your Operating System is Windows XP. You are using a Screen Resolution of 1024x768 and your DPI is 72.

Fire
Fire
  • Member since: Oct. 29, 2003
  • Offline.
Forum Stats
Member
Level 15
Programmer
Response to AS: Costumization w/ "capabilities" Dec. 26th, 2005 @ 01:35 PM Reply

At 8/13/05 08:36 AM, -liam- wrote: I just made this for no reason at all, it uses System Capabilities.. and I remembered this thread, so heh.. thought I'd post it.

http://img299.images..mcapabilities6oa.swf



Your language is set to English, your computer can play music, your computer can play MP3s. You can encode audio, can print and can debug. Your Operating System is Windows XP. You are using a Screen Resolution of 1024x768 and your DPI is 72.

Your language is set to English, your computer can play music, your computer can play MP3s. You can encode audio, can print and can debug. Your Operating System is Windows XP. You are using a Screen Resolution of 1280x1024 and your DPI is 72.

PiGPEN
PiGPEN
  • Member since: May. 11, 2001
  • Offline.
Forum Stats
Member
Level 22
Animator
Response to AS: Costumization w/ "capabilities" Dec. 26th, 2005 @ 03:35 PM Reply

Your language is set to Pig-Latin, your computer can play mini-golf, your computer can play blind-folded. You can encode into morse-code, can dot and can dash. Your Operating System is about to crash. You are using a New Year's Resolution of "I won't masturbate." and your COS is null.


BBS Signature
fwe
fwe
  • Member since: Jul. 24, 2003
  • Offline.
Forum Stats
Member
Level 08
Blank Slate
Response to AS: Costumization w/ "capabilities" Dec. 26th, 2005 @ 03:59 PM Reply

At 12/26/05 01:35 PM, GameCubeFreak2004 wrote: Your language is set to English, your computer can play music, your computer can play MP3s. You can encode audio, can print and can debug. Your Operating System is Windows XP. You are using a Screen Resolution of 1280x1024 and your DPI is 72.

Did you really feel the need to bump this 4 month old topic to include some info no one gives a shit about?


wtfbbqhax

Rantzien
Rantzien
  • Member since: Jan. 27, 2005
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Response to AS: Costumization w/ "capabilities" Dec. 26th, 2005 @ 04:01 PM Reply

At 12/26/05 03:59 PM, fwe wrote: Did you really feel the need to bump this 4 month old topic to include some info no one gives a shit about?

Actually, I always wanted to know whether he could print or not.


BBS Signature
fwe
fwe
  • Member since: Jul. 24, 2003
  • Offline.
Forum Stats
Member
Level 08
Blank Slate
Response to AS: Costumization w/ "capabilities" Dec. 26th, 2005 @ 04:08 PM Reply

At 12/26/05 04:01 PM, Rantzylvester wrote: Actually, I always wanted to know whether he could print or not.

Haha, that made my day

whew


wtfbbqhax

authorblues
authorblues
  • Member since: Jun. 21, 2005
  • Offline.
Forum Stats
Member
Level 12
Blank Slate
Response to AS: Costumization w/ "capabilities" Dec. 26th, 2005 @ 04:18 PM Reply

At 12/26/05 04:01 PM, Rantzylvester wrote: Actually, I always wanted to know whether he could print or not.

one day, when you guys arent expecting it, im going to make a SWF that does nothing but print 100 pages of gay porn, just for you ranty...


BBS Signature
Rustygames
Rustygames
  • Member since: May. 7, 2005
  • Offline.
Forum Stats
Member
Level 19
Programmer
Response to AS: Costumization w/ "capabilities" Dec. 26th, 2005 @ 04:22 PM Reply

At 12/26/05 04:18 PM, authorblues wrote:
At 12/26/05 04:01 PM, Rantzylvester wrote: Actually, I always wanted to know whether he could print or not.
one day, when you guys arent expecting it, im going to make a SWF that does nothing but print 100 pages of gay porn, just for you ranty...

Yeah but we have to accept it and I dont think anyone is going to let a flash print off 100 pages before checking out the first page:P


- Matt, Rustyarcade.com

Rantzien
Rantzien
  • Member since: Jan. 27, 2005
  • Offline.
Forum Stats
Member
Level 15
Blank Slate
Response to AS: Costumization w/ "capabilities" Dec. 26th, 2005 @ 04:25 PM Reply

At 12/26/05 04:18 PM, authorblues wrote: one day, when you guys arent expecting it, im going to make a SWF that does nothing but print 100 pages of gay porn, just for you ranty...

=´)
I'm touched all the way down to my knees.

Now go answer my question, you stud!

At 12/26/05 04:22 PM, Ninja-Chicken wrote: Yeah but we have to accept it and I dont think anyone is going to let a flash print off 100 pages before checking out the first page:P

=P


BBS Signature
EmoNarc
EmoNarc
  • Member since: May. 1, 2005
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to AS: Costumization w/ "capabilities" Dec. 26th, 2005 @ 05:55 PM Reply

§h¤+, that's cool...

Elementrat
Elementrat
  • Member since: Jul. 16, 2005
  • Offline.
Forum Stats
Member
Level 12
Blank Slate
Response to AS: Costumization w/ "capabilities" Aug. 3rd, 2006 @ 08:49 PM Reply

very kool but kind of useless here on NG where English is teh_lang


OS: Ace, coming soon to Newgrounds. Keep an eye out for it.

BBS Signature
tomylee
tomylee
  • Member since: Dec. 17, 2004
  • Offline.
Forum Stats
Member
Level 28
Blank Slate
Response to AS: Costumization w/ "capabilities" Aug. 3rd, 2006 @ 09:58 PM Reply

Wow, i will give it a try!
Its awesome, i learned english, but its awesome to see just you can configure it in other languages!
But yeah, we should all know english =P

Inglor
Inglor
  • Member since: Jan. 26, 2003
  • Offline.
Forum Stats
Member
Level 17
Blank Slate
Response to AS: Costumization w/ "capabilities" Aug. 3rd, 2006 @ 10:05 PM Reply

Your language is set to English, your computer can play music, your computer can play MP3s. You can encode audio, can print and can debug. Your Operating System is Windows XP. You are using a Screen Resolution of 2048x1536 and your DPI is 96.

fwe
fwe
  • Member since: Jul. 24, 2003
  • Offline.
Forum Stats
Member
Level 08
Blank Slate
Response to AS: Costumization w/ "capabilities" Aug. 3rd, 2006 @ 11:06 PM Reply

At 12/26/05 04:08 PM, fwe wrote:
At 12/26/05 04:01 PM, Rantzylvester wrote: Actually, I always wanted to know whether he could print or not.
Haha, that made my day

whew

Oh boy, I just read this again. Fucking good times


wtfbbqhax

s1nt3ch
s1nt3ch
  • Member since: Jul. 2, 2002
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to AS: Costumization w/ "capabilities" Aug. 3rd, 2006 @ 11:08 PM Reply

wierd, it's not working for me, i know this thread is old, but the last poster got it.....
:(


BBS Signature