Flex SDK includes a set of HTML templates in the flex_install_dir/templates directory. For Flex Builder, these files are located in the install_dir/sdks/3.0.0/templates directory. These templates provide a basic wrapper, as well as wrappers that implement various features. The following table describes the templates:
|
Directory |
Description |
|---|---|
|
client-side-detection |
Provides scripts that detect the version of the client's player and return alternate content if the client's player does not meet the minimum required version. |
|
client-side-detection-with-history |
Provides the same scripts as those in the client-side-detection directory, but adds deep linking support. |
|
express-installation |
Provides scripts that support Express Install, which includes client-side version detection. |
|
express-installation-with-history |
Provides scripts that support Express Install and deep linking. |
|
no-player-detection |
Provides a basic wrapper that embeds the SWF file by using an external JavaScript file. |
|
no-player-detection-with-history |
Provides a basic wrapper with deep linking support. |
You typically use the index.template.html file found in each of these directories as the main HTML file that embeds your Flex application. For deployment, you should rename this file to index.html or whatever filename fits your web site's design. If you already have the HTML set up for your web site and are incorporating Flex into that site, then you can copy and paste the code from these templates to your existing web site's files. The template HTML also works with dynamic scripting code such as PHP, ASP, or JSP.
Each template contains a set of tokens, such as ${height} and ${title}. These tokens are used by Flex Builder to generate the wrapper code. Flex Builder replaces them with the appropriate values when it compiles a project. If you are editing the wrapper manually and deploying an application built with the SDK, then you must replace these tokens with the appropriate values.
In many cases, the tokens set the values of properties and attributes of the <object> and <embed> tags, or values of parameters that you pass to the AC_FL_RunContent() JavaScript method. For details on these properties, see the property's description in About the object and embed tags.
The following table describes the template tokens:
|
Token |
Description |
|---|---|
| ${application} |
Identifies the SWF file to the host environment (a web browser, typically) so that it can be referenced by using a scripting language. This token is the value of the id and name properties that is described in About the object and embed tags. |
| ${bgcolor} |
The background color of the application. This token is the value of the bgcolor property that is described in About the object and embed tags. |
| ${height} |
The height of the application, in pixels. This token is the value of the height property that is described in About the object and embed tags. |
| ${swf} |
Specifies the location of the SWF file. This token is the value of the src and movie properties that is described in About the object and embed tags. |
| ${title} |
The title of the HTML page. This value appears in the browser's title bar when the user requests the HTML page. The default value supplied by Flex Builder is the name of the Flex application. |
| ${version_major} |
The required major version number of Flash Player. For example, 9. This token only appears in the wrappers with Flash Player version detection code. For more information, see Using Express Install. |
| ${version_minor} |
The required minor version number of Flash Player. For example, 0. This token only appears in the wrappers with Flash Player version detection code. For more information, see Using Express Install. |
| ${version_revision} |
The required revision version number of Flash Player. For example, 162. This token only appears in the wrappers with Flash Player version detection code. For more information, see Using Express Install. |
| ${width} |
The width of the application, in pixels. This token is the value of the height property that is described in About the object and embed tags. |
For more information about Express Install, see Adding Express Install to your wrapper. For more information about deep linking, see Adding deep linking to your wrapper.