Specifications

CHAPTER 18
348
# increase number of lines to 10:
lines_in_context=10
Customizing the template
When the web-tier compiler compiles an MXML file into a SWF file, it also generates an HTML wrapper that
embeds that SWF file. The browser first loads the wrapper, which embeds the SWF file. This wrapper is generated
from a template that is included in the web-tier compiler installation.
The template file is in the module_install_dir/templates folder. The default template is default.html.
You specify the location of the template in the compiler.conf configuration file by using the template property;
for example:
template=default.html
For more information on editing the compiler.conf file, see Configuring the web-tier compiler” on page 345.
The template uses several tokens as placeholders that the compiler replaces when it generates the final output. For
example, the token ${swf} is replaced with the MXML file name (minus the MXML file extension).
You can customize the template, but you must adhere to several rules. The new template:
Must be a *.html file.
Must be in the module_install_dir/templates directory.
Must include at least the ${swf} token. You use this token to define the value of the movie parameter in the
<object> tag and the value of the src attribute in the <embed> tag.
Must not use any external script or CSS files. For example, you cannot use code similar to the following in the
template:
<script src="mysource.js"></script>
Limitations of the template
The web-tier compiler is not meant to be used in a production environment. The wrapper does not support the
following features:
History management or deep linking
Player detection and deployment
Express Install