After you write your own wrapper, follow these steps to add support for Express Install. These steps require the following files, which are located in the /templates/express-installation directory:
index.template.html Wrapper file that detects the Flash Player version and initiates Express Install if necessary. You can integrate this code with your website.
AC_OETags.js Script file that provides methods for Flash Player version detection and embedding your Flex application. You call methods in this file from your wrapper.
playerProductInstall.swf Application that initiates Express Install. You deploy this file with your application.
Add Express Install support to your wrapper
// Globals // Major version of Flash required var requiredMajorVersion = 9; // Minor version of Flash required var requiredMinorVersion = 0; // Minor version of Flash required var requiredRevision = 0;
If you are using Flex Builder to generate the wrapper, you can set this value in the Detect Flash Version text box in the Compiler Properties dialog box.
This is useful, too, to ensure that your users have a version of Flash Player that supports certain features. For example, if you want your users' Flash Player to support signed framework RSLs, set the minimum version to 9.0.115.
<script src="AC_OETags.js" language="javascript"></script>
There are multiple calls to this method in script blocks that meet different conditions. In the first script block, change the id and name parameters to match your SWF file's name:
if (hasProductInstall && !hasRequestedVersion) {
AC_FL_RunContent(
"src", "playerProductInstall",
"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+
MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
"width", "100%",
"height", "100%",
"align", "middle",
"id", "MyFirstProject",
"quality", "high",
"bgcolor", "#869ca7",
"name", "MyFirstProject",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.macromedia.com/go/getflashplayer"
);
}
In the second script block, change the src, id, and name parameters to match your SWF file's name:
} else if (hasRequestedVersion) {
AC_FL_RunContent(
"src", "MyFirstProject",
"width", "100%",
"height", "100%",
"align", "middle",
"id", "MyFirstProject",
"quality", "high",
"bgcolor", "#869ca7",
"name", "MyFirstProject",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.macromedia.com/go/getflashplayer"
);
}
When you edit these methods, you can also add flashVars variables, change the height and width of the SWF file, and set other properties of the SWF file, if necessary. For more information about available properties, see About the object and embed tags. For more information about adding deep linking support, see Deep Linking in the Adobe Flex 3 Developer Guide.
By default, you should deploy this file to the same directory as your Flex application. If you deploy it to another location, you must update the wrapper to point to this new location. This file is also included in your Flex application's bin directory in Flex Builder.