Publishing HTML for Flash Player Files

I l @ ve RuBoard

An HTML document is the master set of instructions that tells a browser how to display Web content. The Publish function of Flash creates an HTML document that tells the browser how to display the files that Flash creates when you click the Publish button (in Flash, GIF, JPEG, PNG, or QuickTime format).

The Publish command creates the required HTML by filling in blanks in one of the templates provided with Flash or by using a template that you create. The templates included with Flash contain the basic HTML coding needed to display the formats that are available with the Publish command.

To publish HTML for displaying a Flash file:

  1. Open the Flash document that you want to publish for the Web.

  2. From the File menu, choose Publish Settings.

    The Publish Setting dialog box appears.

  3. Click the Formats tab.

  4. In the Type section, choose HTML (.html).

    When you choose HTML, Flash automatically selects Flash (.swf) as well. To use a file name other than the default, deselect Use Default Names as the Filename option, and type the appropriate name for your Flash and HTML files.

  5. Select the HTML tab (Figure 16.21).

    Figure 16.21. The HTMLtab of the Publish Settings dialog box displays options for displaying your Flash movie in the browser window.

    graphics/16fig21.gif

    Flash displays the options for displaying your Flash movie in the browser window. When you publish the current file, Flash feeds your choices into the appropriate HTML tags and parameters in the template of your choice.

Digitally Recorded Sounds

As motion pictures are to movement, digital recordings are to sound. Both media capture slices of a continuous event. By playing the captured slices back in order, you re-create the event. In a movie, the slices are frames of film; in a digital recording, they're slices of sound.

You can think of the recording process as capturing a sound wave by laying a grid over it and copying a piece of the wave at each intersection on the grid. The lines acros the horizontal axis are the sample rate how often you capture the sound. The lines up and down the vertical axis are the bit rate how much of the sound wave's amplitude you capture. The greater the frequency and bit rate (the finer the mesh of your recording grid), the greater the realism of your recording during playback. Unfortunately, greater realism translates into larger files.

The sound options in the Publish Settings dialog box give you the flexibility to create different versions of your movie with different sample rates and bit rates without actually changing the sounds embedded in the movie. You might allow yourself larger file sizes and higher-quality sounds for a version being delivered on CD-ROM than for a version being distributed on the Web. As you try different sound options, be sure to actually listen to your published sounds to determine the best balance between sound quality and file size .

To choose an HTML template for Flash only:

  • From the Template pop-up menu, choose Flash Only (Figure 16.22).

    Figure 16.22. Choose Flash Only (A) as the template when you want to create HTMLfor displaying only a Flash movie, with no other options for alternative images. Click the Info button (B) to see a description of what the template does (C).

    graphics/16fig22.gif

    This template is the simplest one. It uses the OBJECT and EMBED tags to display your Flash movie for viewers who are properly equipped with the version 6 of Flash Player. Other viewers will be unable to see your movie. (Other template choices create HTML that displays alternative images when the viewer lacks the proper plug-in.)

To choose an HTML template that detects the Flash Player version:

  • From the Template pop-up menu, choose one of the "Detect for" templates.

    The detection templates use JavaScript to check whether a particular version of the Flash Player is installed on a viewer's machine. (Flash MX comes with detection templates for versions 3 through 6 of Flash Player.) If the desired version is not installed, the user can choose to get the Player or view a GIF or JPEG version of your site.

graphics/01icon02.gif Tip

  • If you can't remember what one of the included HTML templates does, click the Info button next to the Template pop-up menu in the HTML tab of the Publish Settings dialog box. Flash displays a brief description, including instructions about which formats to choose.


The Mystery of HTML Templates

The HTML codes (called tags ) required for displaying a .swf file in a browser window are OBJECT for Internet Explorer (Windows) and EMBED for Netscape Navigator (Mac and Windows) and Internet Explorer (Mac). (In addition, Flash can use the IMG tag to display a file in another format, such as a JPEG image or an animated GIF. If you have created named anchors in your Flash movie and you choose the Flash with Named Anchors template, Flash can create anchor tags for browser navigation, as well.)

Flash's Publish command works hand in hand with HTML templateswhich are fill-in-the-blank recipesto define the parameters of those tags. These parameters include the width and height of the movie window, the quality of the images (the amount of antialiasing to provide), and the way the movie window aligns with the browser window.

Each option and parameter in the HTML tab of the Publish Settings dialog box has an equivalent template variable. The template variable is a code word that starts with the dollar sign ( $ ). When you choose an option in the Publish Settings dialog box, Flash enters your choice as an HTML tag that replaces the variable in the template document. If you set the width of your movie as 500 pixels in the Publish Settings dialog box for HTML, for example, Flash replaces the template variable for width ( $WI ) with the proper coding to display the movie in a window 500 pixels wide.

Flash's HTML templates contain coding not only for displaying your Flash movie, but also for showing the JPEG, GIF, or PNG versions of your movie that you want to make available to viewers who don't have the proper browser player to view Flash.

During the publishing process, Flash saves a copy of the HTML template for your movie, giving it the name of your movie file and adding whatever extension the template file has. (The template files that come with Flash MX use the extension .html, for example.) You can go into a template file as you would any other text file and modify the HTML coding.

You can extend the Publish command's capacity for creating HTML documents by setting up your own HTML templates. To be available to Flash's template menu, the HTML file must include a title (use the code $TT ). The HTML file must be inside the HTML folder (Macromedia/Flash MX/ Configuration/HTML), which you'll find in the Application Support (Mac) or Application Data (Windows) folder on the drive where you've installed Flash.

I l @ ve RuBoard


Macromedia Flash MX for Windows and Macintosh. Visual QuickStart Guide
Macromedia Flash MX 2004 for Windows and Macintosh (Visual QuickStart Guides)
ISBN: 0582851165
EAN: 2147483647
Year: 2002
Pages: 243

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net