开发者

Flex question: am I running in AIR or Flex?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜