An Approach to setting wmode for Stage3D project in Flash Builder

85 篇文章 0 订阅
64 篇文章 0 订阅

There are a lot of posts on how to configure projects to get up and running with Stage3D. With Flash Builder 4.6 and Flex 4.6 SDK some of the steps are not needed, like getting a different playerglobal.swc and setting the -swf-version=13. But you still need to set the wmode="direct" in theindex.template.html for Stage3D content to run.

Reading a bunch of posts some people just change this by hand for each project. Others post about how to change the index.template.html in the SDK templates folder. A drawback with this last approach is then all your projects will havewmode="direct" turned on, which is not necessarily bad but could cause issues in some cases.

My approach is a middle ground, I add a new template file to the templates that has the wmode="direct" enabled. Then you have the option to use the wmode="direct" by just changing your run configuration to point to this new template html file. Which I call direct.template.html and it comes out as direct.html in the bin-debug folder along side the AppName.html file. The drawback here is if you have projects that have multiple applications it will only copy over this second template for the default application. For this specific drawback you can just copy the direct.template.htmlover index.template.html (since direct.template.html will be in the project) and then have all them set to direct. This still gives you control over what you project should run at but not go looking for how to modify the index.template.html for each new project. Read on to see the steps I take to setup this up.

Steps to add direct.template.html and change run configuration

  • Download or copy source from http://renaun.com/flex4/direct.template.txt and save it as direct.template.html in the following folder:
    • Win: C:\Program Files (x86)\Adobe\Adobe Flash Builder 4.6\sdks\4.6.0\templates\swfobject
    • Mac: /Applications/Adobe Flash Builder 4.6/sdks/4.6.0/templates/swfobject
  • Create a new Flex or ActionScript Project (web not mobile). Check to see ifdirect.template.html is in the html-template folder.
  • Run the application once to create default run configuration.
  • Click on Run -> Run Configurations…
  • Select the Project’s run configuration and deselect “Use default” in the “URL or path to launch”
  • Change the last .html file name to “direct.html”, leaving the rest of the path the same. See image below:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值