Wednesday, October 3, 2012

Setting up FDT 5.6 to use latest the version of Flash Player and use Stage3D

Few things are more frustrating than trying to learn new things by checking out examples and they don't work. I've run into that situation when trying to tinker around with Stage3D for the Flash Player web plugin .

Set for up Stage3D

It is necessary to jump through a few hoops before you can utilize the Stage3D features for the web plugin. They are the following:

  1. Make sure you set wmode to "direct".
  2. Make sure your are targeting Flash Player 11+ and that your Flash Player version is 11+ (get latest here. If you are testing in Chrome see about plugins).
  3. Make sure you set -swf-version compiler option to the appropriate value (In FDT you can do this in the Compiler Arguments tab of the Run Configuration panel).
Note that have to run the swf in the browser (which is running the Flash Player 11+ plugin) so that you can set the wmode parameter to "direct".

Set up FDT


If you use FDT to compile your swf files you know you must get the latest version of the Flex SDK. At the time I downloaded Flex SDK 4.6, it could only compile to Flash Player 11.1. That's because the 4.6 SDK only comes with the playerglobal.swc file for Flash Player 11.1. In order to publish to the latest version of Flash Player you need to do a few things:

  1. Download the latest version of the playerglobal.swc.
  2. Install the downloaded swc file into the frameworks/libs/player/[player version] directory within your Flex SDK installation. You'll notice that in the  frameworks/libs/player directory there is already the 11.1 folder which contains the playerglobal.swc for publishing swf files to Flash Player 11.1. Create another folder in frameworks/libs/player directory and name it the version Flash Player which the playerglobal.swc will publish to (At the time of this writing, 11.4 was the latest) and copy/paste the new playerglobal.swc into the new 11.4 folder.
  3. Now go to your FDT Templates folder. This will be located in your Users folder on Windows 7. For example: C:\Users\{user name}\AppData\Roaming\FDT.
  4. Open the sdks.xml file located in the FDT directory. Do a search for "11.1" in this file (If you have Flex SDK 4.6 as an installed SDK in FDT, then you should find 11.1). Copy the xml node named "swc" which contains 11.1 and paste it directly below. In the new swc node change 11.1 to 11.4. Save the sdks.xml file.
Now when you create a new project (or change the SDK of an existing project) you will have the option publishing to 11.1 or 11.4. This can be set within the Player Version drop down.

No comments: