Customizing Flex Builder’s HTML templates

When you create a new project, Flex Builder creates a directory in the project called html-template, which contains a generic HTML wrapper for your Flash application. The files in that directory are based on the project properties under the “Flex Compiler” tab (for Flex projects) or the “ActionScript Compiler” tab (for ActionScript projects).

If you want to customize the template for a single project, that’s easy — just modify the files that are in <myproject>\html-template.

If you want to modify the templates that are generated for all new projects, that can be done too, although it takes a little more effort. The HTML wrappers are in

    <myworkspace>\.metadata\.plugins\
        com.adobe.flexbuilder.project\html-templates

where <myworkspace> is, um, your workspace — that is, the directory you see if you do File > Switch Workspace. (After doing File > Switch Workspace and copying the dir, you can just click Cancel, to sta in the current workspace.)

In that directory, you will see six subdirectories. These correspond to the different options in the above-mentioned project properties page:

  • client-side-detection
  • client-side-detection-with-history
  • express-installation
  • express-installation-with-history
  • no-player-detection
  • no-player-detection-with-history

So, go to those directories; customize all you want; and then re-launch Flex Builder. From then on, any new projects you create will use the modified templates.

I should warn you that if you make any customizations in this area, there is a chance they may get clobbered when the final release of Flex Builder comes out.

5 Comments so far

  1. sascha of H1DD3N.R350URC3 on May 19th, 2006

    Interesting! Do you know where Eclipse stores it’s settings for the editors code colors? I’d like to change the default blue and green Flex/AS3.0 Code colors and the beta3 has no settings for this yet.

  2. Dreamer on May 20th, 2006

    thank you. I think I will backup before I do it. :)

  3. Chris Charlton on August 9th, 2006

    I read, in Flex 2’s Help, that Express Install is default in Flex Builder and Flex Data Services compiling. Glad it’s the default.

  4. Mark on December 7th, 2007

    After changing index.template.html, I found I had to do Project->Clean… for it to take effect. (Using FLEX 3 Beta 2)

  5. mike on December 7th, 2007

    Yes Mark, we found that bug, and fixed it after Beta 2 ( http://bugs.adobe.com/jira/browse/FB-9748 ). Thanks!

Leave a reply

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word