Flex Html-Template filetype to CFM instead of HTML
Thanks to Mike, I was able to change my Flex builder to create a ColdFusion HTML-Template in the bin directory, instead of an HTML template. I needed to do this to accommodate passing URL or Query values to my Flex application.
The solution that Mike provided gets 10 cool points for using Flex Builder’s built-in macro functionality to change the default html-template output format from HTML to a ColdFusion (CFM) template file!
If you have ever delved into some of the project files that Flex uses you may have noticed some variable-like parts of the file that usually look like ${some_keyword}. These items are little macro keywords that Flex Builder checks for in specific files to replace them with appropriate data.
Mike said in his post that you cannot simply change the html-template extension from html to cfm because of the way Flex Builder handles that file. You need to find the file called index.template.html inside of your html-template folder inside your current project’s folder. Once you have found that file, rename it to:
${application}${build_suffix}.template.cfm
Next, you need to go to Project -> Clean in order for the changes to take effect. However, you will be distraught when you go to Run your project and see that now your browser displays a Page Cannot Be Found error. If you check the URL that it is attempting to access the template file with an html extension still. To correct this, close the browser and go into Flex Builder and click the submenu arrow for the debug toolbar button and Ctrl + Click the project you are working on. In the Debug Properties pane you will notice that the values for the Debug and Run paths are still pointing to an html file. Simple update those paths to point to a cfm file instead. Click Apply and then Close.
Finally, you need to Clean (Project -> Clean) your project one more time. Run your project now and all should be good. Once you have done this, you will be able to do cool things like pass URL or query variables into your Flex project.







Thanks a heap mate! I’ve been wondering how this can be done! Cheers.
It’s my pleasure! Glad I could help.
Very useful, thanks for that.
nice Post (Y)