Mike Morearty
19 May 2006

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


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:

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.

comments powered by Disqus