Mar 3, 2011

Set FlashDevelop to Use FlashPlayer 11 and Away3D v4 "Broomstick"

>untuk versi bahasa Indonesia bisa dibaca di : http://bit.ly/fd1xLA<

Intro:
As we know that Adobe just released Flash Player 11 (Incubator Build) and one of the features is Molehill API. Molehill is the codename for the set of 3D GPU accelerated API that will be exposed Actionscript 3. Molehill will rely on DirectX9 in Windows and OpenGL in MacOS and Linux, it’s mean that high-end 3D rendering is built inside Flash Player, ensuring smooth and fast 3D content. This API is very low-level programming, so that people without knowledge of OpenGL/DirectX sometimes will find some difficulty to implement. Fortunately, there’s already many famous flash 3D framework (e.g, Away3D, Flare3D and Alternativa) that support Molehill API. In this post I’ll cover about how to work with Away3D and FlashDevelop IDE.

Previously, I assume that you already have FlashDevelop installed and know how to compile Actionscript project with FD.


The files that are needed in this tutorial:
  1. Latest Flex SDK (4.5.0.19876) you can grab ithere
  2. flashplayer_inc_playerglobal_022711.swc, download ithere. Note: if after you download the file and the extension become .zip, just rename it into .swc
  3. Away3D 4.0 Alpha, download ithere
  4. Download and install Flash Player 11. Grab Flash Player 11here

The steps to set FlashDevelop.
  1. Unzip Flex SDK
  2. Make folder named “10.1” in {FlexSDK}/frameworks/libs/player. (note: this folder is needed because the latest FlashDevelop just support to build into Flash Player until version 10.1)
  3. Copy file flashplayer_inc_playerglobal_022711.swc into “10.1” folder and rename it into playerglobal.swc
  4. Set FlashDevelop to use the latest Flex SDK
  5. Copy Away3D v4 folder into “src” folder
  6. For every project that will be build into Flash Player 11, ensure you do the following:
  • Make sure that the targetted Flash Player is Flash Player 10.1 and in the “Test Movie” option, choose “Play in popup” (note: play in popup is like we play swf in browser, we choose this option because there’s still no Standalone Flash Player 11)
 
  • Add compiler argument -swf-version=13 in “Additional Compiler Option”
 

*Most likely your FlashDevelop will run slow and use high CPU process (note: if you use laptop, your processor’s fan will spin very fast). Then when you close your FlashDevelop, this warning popup will show:

To avoid this, just rename or delete “playerglobal_rb.swc” in {FlexSDK}/frameworks/locale/en_US/ (note: this file is a documentation for playerglobal.swc, so it’s safe to rename/delete this file)

You can download my experiment (of course using FlashDevelop and Away3D v4) here. I don’t include Away3D folder so just copy downloaded Away3D into “src” folder.

Update: add parameter "wmode=direct" in generated html file (default is index.html) to make sure that your Molehill object is rendered by GPU.

3 comments:

  1. Nice and Easy start-up guide! thanks!

    ReplyDelete
  2. so it’s **safe** to rename/delete this file)

    Instead of save.

    Very good though. Its a little much for me to do for a single project, but now that it is offically OUT, hopefully all our projects will go over to it eventually.

    ReplyDelete