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!');
}
精彩评论