ActionScript for Flash MX. The Definitive Guide
Authors: Moock C
Published year: 2002
Pages: 276-278/780
Buy this book on amazon.com >>
ActionScript for Flash MX: The Definitive Guide, 2nd Edition
By Colin Moock
Chapter 18.  ActionScript Language Reference
capabilities.screenResolutionY Property Flash 6

the height of the screen, in pixels read/write
System.capabilities.screenResolutionY

Description

The integer screenResolutionY property returns the total height, in pixels, of the screen on which the Flash Player is displayed. It is analogous to JavaScript's Screen.height property. To retrieve the height of a movie's Stage rather than the whole screen, use Stage.height .

The corresponding server string for screenResolutionY is R , with a possible value that includes both the width and height of the screen, formatted as " WIDTH x HEIGHT " (for example, "800x600"). See capabilities.screenResolutionX for an example that checks the screen resolution.

Bugs

In the first release of Macromedia's documentation for Flash MX, this property is incorrectly listed as System.capabilities.screenResolution.y . There should be no period before the final y , and the Y should be capitalized.

See Also

capabilities.pixelAspectRatio , capabilities.screenDPI , capabilities.screenResolutionX , Stage.height

ActionScript for Flash MX: The Definitive Guide, 2nd Edition
By Colin Moock
Chapter 18.  ActionScript Language Reference
capabilities.serverString Property Flash 6

all Capabilities object property values, as a string of URL-encoded variables read/write
System.capabilities.serverString

Description

The string serverString property contains a list of URL-encoded variable names and values corresponding to the property names and values of the Capabilities object.

For example, on my system, the value of serverString is:

A=t&MP3=t&AE=t&VE=t&ACC=f&DEB=t&V=WIN%206%2C0%2C21%2C0&M=Macromedia Windows&
R=1600x1200&DP=72&COL=color&AR=1.0&I=point&OS=Windows XP&L=en

To determine the variable name and value used for each property, see the entry for that property. The serverString property is provided as a convenience to the developer who wishes to retrieve assets from the server, based on the client-side Player specifications. The string can be used when loading external XML, variables, or even other movies. For example, a simple movie, loadStub.swf , could be used as a loading module for subsequent content. The loadStub.swf movie should issue a loadMovie( ) command to a server script and append the serverString property value to a GET request:

content_mc.loadMovie("content.swf?" + System.capabilities.serverString);

The server would then respond by sending the appropriate movie for the client-side environment.

Usage

Though the properties of the Capabilities object are writable, custom property assignments are not reflected in the value of serverString .

See Also

MovieClip.loadMovie( ) , the LoadVars class, the XML class

ActionScript for Flash MX: The Definitive Guide, 2nd Edition
By Colin  Moock
Chapter 18.  ActionScript Language Reference
capabilities.version Property Flash 6

the Flash Player version read/write
System.capabilities.version

Description

The string version property contains version and platform information for the Flash Player hosting the current movie. As of Flash 6, it is favored over the getVersion( ) function, though the two return the same value. Because capabilites.version is not available in Flash 5, getVersion( ) must be used for movies that will be played in Flash Player 5. Similarly, $version must be used for movies played in Flash Player 4.

The string stored in version takes the form:



platform




majorVersion


,


minorVersion


,


buildNumber


,


patch


where platform is a code indicating the platform ( "WIN" , "MAC" , or "UNIX" ), followed by the major version number, the minor version number, and the build (a.k.a. revision) number. The last item, patch , is typically 0. For example:

WIN 5,0,30,0   // Version 5.0, Build 30 (5.0r30) on Windows 
MAC 5,0,41,0   // Version 5.0, Build 41 (5.0r41) on Macintosh
UNIX 4,0,12,0  // Version 4.0, Build 12 (4.0r12) on Unix

To obtain a more detailed description of the current operating system, use capabilities.os .

In Test Movie mode, version reports the version number of the Player embedded in the authoring tool (which is not the same as the version of the authoring tool itself). For example, the Flash 5 authoring tool embeds the 5.0 r30 version of the Player, so it has a version of:

WIN 5,0,30,0

or:

MAC 5,0,30,0

Any time a major or minor version of the authoring tool is created, the buildNumber restarts at 0. However, in the typical development cycle of the Flash authoring tool, many builds of the Flash Player are produced before the final version of the authoring tool is released. Hence, the build number of the first new major version of a Player is usually greater than 0. For example, Flash Player 5 was first officially released at Build 30. Flash Player 6 was officially released at Build 23. A movie running in the first publicly released Flash Player 6 on Windows has a version of WIN 6,0,23,0.

Typically, we're concerned only with the platform, the major version, and the build number of a Player. To extract the portion of the version string we're after, we can use the string manipulation tools described in Chapter 4, or we can construct a custom object with each component of the version string assigned to a property of that object, as shown in the following Example.

When a movie is embedded in the browser, JavaScript and VBScript provide external tools for version detection, browser sniffing, and automatic page redirection. For details on detecting the Flash Player's presence and version with JavaScript and VBScript, see:

http://www.moock.org/webdesign/flash/detection/moockfpi

The corresponding server string for version is V , with possible values as described earlier in this Description.

Example

The following code extracts the various portions of the version string and stores them as the properties of an object for easy access:

// Split up the


version


string into usable pieces.
var version = System.capabilities.version;
var firstSpace = version.indexOf(" ");
var tempString = version.substring(firstSpace + 1, version.length);
var tempArray = tempString.split(",");
   
// Assign the various parts of the


getVersion( )


string to our object.
// Note that we convert the version number portions to integers.
var thePlayer = new Object();
thePlayer.platform = version.substring(0,firstSpace);
thePlayer.majorVersion = parseInt(tempArray[0]);
thePlayer.minorVersion = parseInt(tempArray[1]);
thePlayer.build = parseInt(tempArray[2]);
thePlayer.patch = parseInt(tempArray[3]);
   
// Now use our object to perform version-specific code.
if ((thePlayer.majorVersion =  = 6) && (thePlayer.build <= 23))  {
  this.createTextField("warning_txt", 1, 300, 300, 250, 30);
  this.warning_txt.border = true;
  this.warning_txt.text = "Please upgrade your Player to avoid streaming bugs.";
}

Bugs

Macromedia's documentation for Flash MX incorrectly claims that the server string for version is VER (it actually is V ) and that the value of version is an integer (it actually is a string).

See Also

capabilities.os , getVersion( ) , $version

ActionScript for Flash MX. The Definitive Guide
Authors: Moock C
Published year: 2002
Pages: 276-278/780
Buy this book on amazon.com >>

Similar books on Amazon