Flash Player Version Test

The following code tests for Flash Player version and returns true for 10.1 and greater:

private var fp10_1:Boolean;
private function init():void
{
    trace("Flash Player Version: " + Capabilities.version);
    fp10_1 = isFP10_1();
    trace("fp10.1:"+fp10_1);
} 

private function isFP10_1():Boolean
{
    var va:Array = Capabilities.version.split(" ")[1].toString().split(",");
    if(int(va[0]) > 10) return true;
    if(int(va[0]) < 10) return false;
    if(int(va[1]) > 1) return true;
    if(int(va[1]) < 1) return false;
    return true;
}

Leave a comment