Reputation: 387
I have some common actionscript code, how can I determine if I'm running in AIR or in a web browser? thanks,
Upvotes: 0
Views: 235
Reputation: 6485
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");
Upvotes: 4
Reputation: 2936
You're going to use
flash.system.Capabilities
if( flash.system.Capabilities.playerType == "Desktop" ){
trace('You are running AIR!');
}
Upvotes: 0