蒋志新.com

专注WEB开发

Alternate HTML content should be placed here. This content requires the Adobe Flash Player. Get Flash [转]

最近在用FLEX写东西,运行HTML时候总提示:Alternate HTML content should be placed here. This content requires the Adobe Flash Player,开始以为FLASH版本问题,重新装了几次还是老样子,打开JS文件调试了会,终于知道问题出在哪了。
在生成的JS文件中有段这样的语句:

  1. function ControlVersion()
  2. ...{
  3.     var version;
  4.     var axo;
  5.     var e;
  6.  
  7.     // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
  8.  
  9.     try ...{
  10.         // version will be set for 7.X or greater players
  11.         axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
  12.         version = axo.GetVariable("$version");
  13.    
  14.     } catch (e) ...{
  15.    
  16.     }
  17.  
  18.     if (!version)
  19.     ...{
  20.         try ...{
  21.             // version will be set for 6.X players only
  22.             axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
  23.            
  24.             // installed player is some revision of 6.0
  25.             // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
  26.             // so we have to be careful.
  27.            
  28.             // default to the first public version
  29.             version = "WIN 6,0,21,0";
  30.  
  31.             // throws if AllowScripAccess does not exist (introduced in 6.0r47)       
  32.             axo.AllowScriptAccess = "always";
  33.  
  34.             // safe to call for 6.0r47 or greater
  35.             version = axo.GetVariable("$version");
  36.  
  37.         } catch (e) ...{
  38.         }
  39.     }
  40.  
  41.     if (!version)
  42.     ...{
  43.         try ...{
  44.             // version will be set for 4.X or 5.X player
  45.             axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
  46.             version = axo.GetVariable("$version");
  47.         } catch (e) ...{
  48.         }
  49.     }
  50.  
  51.     if (!version)
  52.     ...{
  53.         try ...{
  54.             // version will be set for 3.X player
  55.             axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
  56.             version = "WIN 3,0,18,0";
  57.         } catch (e) ...{
  58.         }
  59.     }
  60.  
  61.     if (!version)
  62.     ...{
  63.         try ...{
  64.             // version will be set for 2.X player
  65.             axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
  66.             version = "WIN 2,0,0,11";
  67.         } catch (e) ...{
  68.             version = -1;
  69.         }
  70.     }
  71.    
  72.     return version;
  73. }

在IE7中运行这段代码的时候,函数最后会运行到,最后一个if(!verson),此时返回的是WIN 2,0,0,11,之后代码
又截取到版本为2并与你要求的FLASH版本号对比(如9),此时就提示你版本太低,产生这个原因,大约是因为FLASH并没有严格按照COM组件的标准,在获取版本号时产生错误,Firfox下 不会有这样的错误。

解决方法是,使用Firfox调试你的程序,或者修改

  1. if (!version)
  2.     {
  3.         try {
  4.             // version will be set for 2.X player
  5.             axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
  6.             version = "WIN 2,0,0,11";
  7.         } catch (e) {
  8.             version = -1;
  9.         }
  10.     }
  11. if (!version)
  12.     {
  13.         try {
  14.             // version will be set for 2.X player
  15.             axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
  16.             version=axo.GetVariable("$version");
  17.         } catch (e) {
  18.             version = "WIN 2,0,0,11";
  19.         }
  20.     }

这样就可以了,至于其他电脑上的兼容问题,有待进一步的调试。

相关日志

Leave a comment

您必须 登录 后才能发表留言。

无分类


无分类


无分类


无分类


无分类

无分类


无分类


无分类


无分类


无分类


无分类

无分类