Adobe Flex 3 Help

Customizing the wrapper

Use the following guidelines when you create a custom wrapper.

  • You can use the HTML templates in the /templates directory as guides to adding new features to the wrapper. For information about the templates, see About the HTML templates.
  • You must embed the SWF file and not the MXML file. Set the value of the src property of the <object> tag to mxml_filename.mxml.swf if you use the web-tier compiler. If you use the command-line compiler or Flex Builder, set the value of the src property to mxml_filename.swf.

    The following example defines the src property of the <object> tag for an MXML application called MyApp.mxml:

    <param name='src' value='MyApp.mxml.swf'>
    
    

    The <embed> tag uses the src property to define the source of the SWF file:

    src='MyApp.mxml.swf'
    
    
  • Do not include periods or other special characters in the id and name properties of the <object> and <embed> tags. These tags identify the SWF object on the page, and you use them when you use the ExternalInterface API. This API lets Flex communicate with the wrapper, and vice versa. For more information about using the ExternalInterface API, see Communicating with the Wrapper.
  • Do not put the contents of the JavaScript file directly in the HTML page. This causes Internet Explorer to prompt the user before enabling Flash Player. If the client has "Disable Script Debugging (Internet Explorer)" unchecked in Internet Explorer's advanced settings, the browser still prompts the user to load the ActiveX plug-in before running it.
  • If you use both the <object> and the <embed> tags in your custom wrapper, use identical values for each attribute to ensure consistent playback across browsers. For more information about the <object> and the <embed> tags, see About the object and embed tags.
  • To add basic player detection logic without deep linking or Express Install support, use the templates in the /templates/client-side-detection directory. For more information, see Editing your wrapper for Express Install.
  • To add support for deep linking, follow the instructions in Deep Linking.
  • To add support for Flash Player detection, follow the instructions in About Express Install.
  • When using Flex Builder, the default wrapper includes deep linking and Express Install support. You can disable one or both of these features by using the Compiler Properties dialog box. You can also use this dialog box to set the minimum required version of the Flash Player.