Using HTML for Alternative Images

I l @ ve RuBoard

Although most of your viewers will have access to the plug-ins that they need to view your Flash movies, some may not. You can make at least some of your site available to them by providing alternative image files for their browsers to display. If you're using Flash animations for a simple Web banner, for example, you could use an animated GIF to re-create that banner for viewers who lack the Flash plug-in. The other alternative files types are JPEG, PNG, and QuickTime.

To publish HTML for displaying an animated GIF:

  1. Open the Flash document for which you want to create an alternative GIF image.

  2. Choose File > Publish Settings. The Publish Setting dialog box appears.

  3. In the Formats tab, choose GIF Image (.gif) and HTML (.html).

  4. Set the options for Flash as described in "Working with Flash Player Settings" earlier in this chapter.

  5. In the HTML tab, from the Template pop-up menu, choose any of the "Detect for" templates (Figure 16.30).

    Figure 16.30. All of the "Detect for" HTMLtemplates will display alternative images if your viewer doesn't have access to the specified version of Flash Player. When you choose one of these templates, you must also choose one of the alternative formats, such as GIF.

    graphics/16fig30.gif

    These templates allow Flash to create an HTML document that uses JavaScript to check the viewer's browser for the specified version of Flash Player. If that version, or a later version, is not available, the HTML calls for a display of the animated GIF that you're about to set up and publish.

  6. Set the other HTML options as described in "Publishing HTML for Flash Player Files" earlier in this chapter.

  7. In the GIF tab (Figure 16.31), set GIF options as described in the following exercises.

    Figure 16.31. Click the GIF tab of the Publish Settings dialog box to access the options for creating a static or animated GIF for your alternative image.

    graphics/16fig31.gif

  8. Click Publish.

To set the dimensions of the GIF image:

In the Dimensions section of the GIF tab of the Publish Settings dialog box, do one of the following:

  • To keep the GIF images the same size as the original Flash movie, choose Match Movie (Figure 16.32).

    Figure 16.32. Deselect Match Movie to enter the dimensions you want the published GIF image to be, or choose Match Movie to use the movie's dimensions as the dimensions of your GIF image.

    graphics/16fig32.gif

  • To create a new size for the published GIF image, deselect Match Movie and enter values in the Width and Height fields.

To make an animated GIF:

  1. In the Playback section of the GIF tab of the Publish Settings dialog box, choose Animated (Figure 16.33).

    Figure 16.33. To preserve the motion of your Flash movie (though not the sound or interactivity) for viewers who lack the Flash plug-in, choose Animated in the GIF tab of the Publish Settings dialog box.

    graphics/16fig33.gif

    The animation settings become active.

  2. Choose Loop Continuously.

    You can also limit the number of times that the animation loops by choosing Repeat and typing a number. (Choosing Static makes Flash export only the first frame of the movie as a single GIF image.)

To balance size, download speed, and appearance:

In the Options section of the GIF tab of the Publish Settings dialog box (Figure 16.34), do one of the following:

  • To remove any unused colors from the GIF file's color table, choose Optimize Colors.

  • To make the GIF appear quickly at low resolution and come into focus as the download continues, choose Interlace. (The Interlace option should be used only for static GIFs.)

  • To reduce the size of the file, deselect Smooth. (Select it if you want Flash to create smoothed bitmaps for your animated GIF.)

  • To apply the dither method to solids as well as gradients and bitmapped images, choose Dither Solids (see "To control colors that are not in the current color palette" later in this chapter).

  • To reduce file size by converting gradient fills to solid fills, choose Remove Gradients. (Flash uses the first color in the gradient as the solid fill color.)

To set a GIF's background transparency:

From the Transparent pop-up menu of the GIF tab of the Publish Settings dialog box (Figure 16.35), do one of the following:

  • To make background areas of the Flash movie opaque in the published GIF, choose Opaque .

  • To make the background areas of the Flash movie transparent in the published GIF, choose Transparent.

    The Alpha and Threshold settings control not only the background of your movie, but also any shapes with transparent fills within the movie.

To control transparency of Flash fill colors in GIFs:

  • From the Transparent pop-up menu in the GIF tab of the Publish Settings dialog box, choose Alpha.

    The Alpha setting makes the GIF's background transparent and allows you to set a threshold below which partially transparent fills in Flash convert to full transparency in the published GIF. The threshold settings are values from 0 to 255 (the number of possible colors in a GIF image).The default threshold value is 128 (corresponding to an Alpha value of 50 percent in Flash).

graphics/01icon02.gif Tip

  • The GIF Alpha transparency setting can have unexpected results, especially in animated GIFs. Full GIF transparency appears only where a filled graphic element sits directly on the background of the Flash movie. Wherever the graphic element overlaps (or moves over) another fill, the "invisible" graphic suddenly pops into view again (Figure 16.36).

    Figure 16.36. When you publish a movie as a GIF, you can make partially transparent graphic elements sitting on the background of the Flash movie look fully transparent in a browser window. Each oval here has the same color fill but a different Alpha value. For this GIF, the Transparent option is set to Alpha with a threshold of 128 (equal to 50 percent Alpha in Flash). The 30 percent and 45 percent ovals are fully transparent where only background lies below them. Where those ovals overlap other graphic elements, however, they are 30 percent and 45 percent transparent, respectively. The 75 percent oval (above the threshold value) retains its partial transparency even over the background.

    graphics/16fig36.gif


If the graphic elements of your Flash file contain colors that are not part of the current color palet e, you must tell Flash how to deal with those colors when creating GIFs for the published movie.

To control colors that are not in the current color palette:

  1. From the Dither pop-up menu of the GIF tab of the Publish Settings dialog box (Figure 16.37), choose one of the following options:

    Figure 16.37. The GIF format has three options for dithering the colors that are not included in the current color table.

    graphics/16fig37.gif

    • To replace the missing color with the closest match from the current palette, choose None.

    • To simulate the missing color by applying a regular pattern of colors from the current palet e, choose Ordered.

    • To simulate the missing color by applying a random pattern of colors from the Web 216 palette, choose Diffusion. (You must also choose Web 216 as your Palette Type in Step 2 for Diffusion to work.)

  2. From the Palette Type pop-up menu, choose a color table for use with this GIF (Figure 16.38).

    Figure 16.38. Choose a palette that optimizes colors for the published GIF image. You can create custom palettes or use the Web-safe or adaptive palettes provided by Flash.

    graphics/16fig38.gif

    Your choices are Web 216 (the standard 216 Web-safe colors), Adaptive (only colors used in your movie; 256 colors maximum), Web Snap Adaptive (a modified Adaptive palette, substituting Web-safe colors for any near matches to colors in the animation that are not Web safe), and Custom (the color table specified in Step 4).

  3. If you chose Adaptive or Web Snap Adaptive as the Palette Type, in the Max Colors field, type the number of colors that you want to use.

    This option allows you to further limit the size of the color table available for the GIF and, thus, reduce file size.

  4. If you chose Custom as the Palette Type, load the custom palette (Figure 16.39).

    Figure 16.39. When you choose Custom from the Palette Type pop-up menu, you must enter a file name in the Palette field. Click the ellipsis button to open a dialog box for locating the file.

    graphics/16fig39.gif

    Click the ellipsis () button. In the file-import dialog box that appears, navigate to the custom palette, select it, and click Import (Mac) or Open (Windows).

graphics/01icon02.gif Tip

  • You don't have to turn your entire movie into an animated GIF. You can tell Flash to publish a subset of the movie's frames . Assign the label #First to the first keyframe of the subset; as ign the label #Last to the keyframe that ends the subset. Flash creates an animated GIF from that range of frames (Figure 16.40).

    Figure 16.40. Assigning the frame labels #First and #Last allows you to limit the range of frames that Flash publishes as an animated GIF.

    graphics/16fig40.gif


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