AS3,判断flash player版本的函数.

判断当前版本是否高于9.0.115.0为例子.

 

private function checkVersion():Boolean
  {
   var verstr:String = Capabilities.version;
   tvie_tracer.print("Flash Player Version is " + verstr);
   var verary:Array = verstr.split(/[,\ ]/);
   var major:Number = Number(verary[1]);
   var rev:Number = Number(verary[3]);
   
   if(major > 9)
    return true;

   if(major == 9 && rev >= 115)
    return true
     
   return false;
  }

你可能感兴趣的:(Flash)