开发者

Flex question: am I running in AIR or Flex?

开发者 https://www.devze.com 2023-03-20 03:44 出处:网络
I have some common actionscript code, how can I determine if I\'m running in AIR or in a w开发者_开发百科eb browser?

I have some common actionscript code, how can I determine if I'm running in AIR or in a w开发者_开发百科eb browser? thanks,


use the flash.system.Capabilities object to find out if you running under AIR/Flash Player.

var isAir : Boolean = (Capabilities.playerType == "Desktop");
var isFlashPlayer : Boolean = (Capabilities.playerType == "StandAlone");
var isBrowser : Boolean = (Capabilities.playerType == "ActiveX" || Capabilities.playerType == "PlugIn");
var isOther : Boolean = (Capabilities.playerType == "External");


You're going to use

flash.system.Capabilities

if( flash.system.Capabilities.playerType == "Desktop" ){
     trace('You are running AIR!');
}
0

精彩评论

暂无评论...
验证码 换一张
取 消