六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 155|回复: 0

Flex中index.template.html模板内容详解

[复制链接]

升级  1.33%

12

主题

12

主题

12

主题

秀才

Rank: 2

积分
52
 楼主| 发表于 2013-2-7 19:10:31 | 显示全部楼层 |阅读模式
index.template.html是Flash Builder中默认生成嵌入flash文件的html网页。
 
 
--------------------------------------
首先会默认引入两个JavaScript文件:<script src="AC_OETags.js" language="javascript"></script><script src="history/history.js" language="javascript"></script>
Ac_OETags.js  -- 是判断浏览器是否安装可用的flash插件的一个JavaScript文件,里面包含了判断各种浏览器中是否有Flash Player插件,flash Player插件的版本号。
 
history.js  --  是用来除了flash程序中浏览记录的一个JavaScript文件,可以用浏览器中的前进后退控制flash程序中的历史信息查阅。(用不到的话,可以去掉该功能,Flex程序中设置application的属性historyManagementEnabled="false")。
 
 
--------------------------------------------------
关于网页样式的控制:
<style>    body { margin: 0px; overflow:hidden }</style><body scroll="no"> 关于浏览器全屏显示flash时需要滚动条的可以使用这个地方。
 
 
---------------------------------------------------
body中会默认有一点JavaScript代码
<script language="JavaScript" type="text/javascript"><!--// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)var hasProductInstall = DetectFlashVer(6, 0, 65);// Version check based upon the values defined in globalsvar hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);//确认flash player是否已经正确安装了if ( hasProductInstall && !hasRequestedVersion ) {// 不要修改下面的四行内容//这个地方将会在需要安装的时候且在安装之后访问//1ine1----------浏览器版本//line2----------浏览器的url//line3----------浏览器标题//line4----------将title赋值给变量var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";var MMredirectURL = window.location;                document.title = document.title.slice(0, 47) + " - Flash Player Installation";                var MMdoctitle = document.title;AC_FL_RunContent(             //设置Objec的参数"src", "playerProductInstall","FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"","width", "${width}","height", "${height}","align", "middle","id", "${application}","quality", "high","bgcolor", "${bgcolor}","name", "${application}","allowScriptAccess","sameDomain","type", "application/x-shockwave-flash","pluginspage", "http://www.adobe.com/go/getflashplayer");} else if (hasRequestedVersion) {//如果检测到的版本可用,那么通过所有测试后后flash会加载swf文件AC_FL_RunContent("src", "${swf}","width", "${width}","height", "${height}","align", "middle","id", "${application}","quality", "high","bgcolor", "${bgcolor}","name", "${application}","wmode","opaque","allowScriptAccess","sameDomain","type", "application/x-shockwave-flash","pluginspage", "http://www.adobe.com/go/getflashplayer");  } else {      //如果flash player版本太老或者没有安装flash player插件    var alternateContent = 'Alternate HTML content should be placed here. '  + 'This content requires the Adobe Flash Player. '   + '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';    document.write(alternateContent);  // insert non-flash content  }// --></script> 如果使用到自定义鼠标右键菜单样式,需要修改Objec中的参数,具体参数,请参考这里:http://apps.hi.baidu.com/share/detail/31648782
 
默认情况下使用RightClick.js,这个地方右键时不会被禁用的,所有需要了解<object>标签。
 
至于flash在网页中的缩放,对齐方式,都可以通过设置object标签的属性来修改。
 
 
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表