flash判断当前使用的浏览器类型
var bType:String = "浏览器ua信息:";
bType += ExternalInterface.call("eval","navigator.userAgent");
bType = bType.toLowerCase();
txt.htmlText = bType;
txt.htmlText +="<br />您使用的是:"
if (bType.indexOf("msie") != -1)
{
if (bType.indexOf("se 2.x") != -1)
{
txt.htmlText += "搜狗浏览器";
}
else
{
txt.htmlText += "IE内核非搜狗浏览器";
}
}
if (bType.indexOf("firefox") != -1)
{
txt.htmlText += "firefox浏览器";
}
if (bType.indexOf("chrome") != -1)
{
txt.htmlText += "firefox浏览器";
}
if (bType.indexOf("opera") != -1)
{
txt.htmlText += "firefox浏览器";
}
if (bType.indexOf("safari") != -1)
{
txt.htmlText += "safari浏览器";
}
bType += ExternalInterface.call("eval","navigator.userAgent");
bType = bType.toLowerCase();
txt.htmlText = bType;
txt.htmlText +="<br />您使用的是:"
if (bType.indexOf("msie") != -1)
{
if (bType.indexOf("se 2.x") != -1)
{
txt.htmlText += "搜狗浏览器";
}
else
{
txt.htmlText += "IE内核非搜狗浏览器";
}
}
if (bType.indexOf("firefox") != -1)
{
txt.htmlText += "firefox浏览器";
}
if (bType.indexOf("chrome") != -1)
{
txt.htmlText += "firefox浏览器";
}
if (bType.indexOf("opera") != -1)
{
txt.htmlText += "firefox浏览器";
}
if (bType.indexOf("safari") != -1)
{
txt.htmlText += "safari浏览器";
}
记得允许脚本执行
<param name="allowScriptAccess" value="sameDomain" />跨域加载的swf,需要value的值为always