Home » Flash, Tutorials

Use Actionscript to Detect Flash Version

24 October 2008 | 7,203 views | No Comment


A friend my mine just asked me how he could find out how to detect his version of flash, so I wrote a quick bit of AS2 to help him out. Here’s a quick and easy way to detect a users flash version from within your Flash project.

//trace(eval("$version"));
version = eval("$version");
//The operating system: WIN, MAC, LNX
var osType;
//The player versions. 9,0,115,0
var majorVersion; 9
var majorRevision; 0
var minorVersion; 115
var minorRevision; 0
vers.text = version;
osArray = version.split(' ');
osType = osArray[0];
versionArray = osArray[1].split(',');
majorVersion = versionArray[0];
majorRevision = versionArray[1];
minorVersion = versionArray[2];
minorRevision = versionArray[3];
feedback.text = "Operating System: "+osType + "\n" +
	"Major Version: "+majorVersion + "\n" +
	"Major Revision: "+majorRevision + "\n" +
	"Minor Version: "+minorVersion + "\n" +
	"Minor Revision: "+minorRevision;
trace("Operating System: "+osType);
trace("Major Version: "+majorVersion);
trace("Major Revision: "+majorRevision);
trace("Minor Version: "+minorVersion);
trace("Minor Revision: "+minorRevision);

Click here to see your version of flash.

Download the source