我有一些常用的动作脚本代码,如何确定我是在AIR中运行还是在Web浏览器中运行? 感谢,
答案 0 :(得分:4)
使用flash.system.Capabilities对象查明您是否在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");
答案 1 :(得分:0)
你将要使用
flash.system.Capabilities
if( flash.system.Capabilities.playerType == "Desktop" ){
trace('You are running AIR!');
}
答案 2 :(得分:0)
就像之前的2个答案一样,
import flash.system.Capabilities;
trace(Capabilities.playerType);
干杯,
编辑: 检查此link以获取Adobe的文档。