Full-screen mode and compatibility with older versions of Flash Player

We’ve implemented in Flex a Web application that supports full screen mode (note a small icon in the top right corner at www.myflex.org). This blogs explains the issue you may run into while implementing the full-screen mode. The process consists of two steps:

1. Identify if the player is capable of displaying the Web application on the full screen.
2. Apply ‘fullScreen’ to displayState property of the stage

The first step is usually done by parsing the version numbers (major, minor and build) of the player using Flex regular expressions:

public static function fullScreenEnabled ():Boolean {

var versionString:String = Capabilities.version;

var version:RegExp = /\w\s+(?P<major>\d+),(?P<minor>\d+),(?P<build>\d+),\d+/;

var result:Array = version.exec (versionString);

var majorVersion:Number = Number (result.major);

var minorVersion:Number = Number (result.minor);

var buildVersion:Number = Number (result.build);

enabled = (majorVersion >= 9) && ((minorVersion > 0) || (buildVersion >= 28));

return enabled;


If you’ll follow some online suggestions on implementing the second step, you’ll run into problems:

this.systemManager.stage.displayState = state?”fullScreen”:”normal” ;// wrong

this.systemManager.stage[“displayState”] = state?”fullScreen”:”normal” ;// won’t work either

Developers in Java and Flex world usually assume that if the code passes compilation ( and here we have strict references ) the linkage issues are resolved. However, this code will throw an exception if executed in older versions of Flash.

Either of the following two approaches will work :

if (“displayState” in systemManager.stage) this.systemManager.stage.displayState = state?”fullScreen”:”normal” ;// OK

try {

if (“displayState” in systemManager.stage) this.systemManager.stage.displayState = state?”fullScreen”:”normal” ;// OK

} catch (e:Exception) {}

It becomes even more relevant when developing components that are reused by both Flex and Adobe AIR.

Thank you,