Chapter 20. Publishing and Exporting

You're done designing, developing, and debugging. Your animation is ready for its audience. You've decided whether you want them to view it on a web page, a CD, or on their computers. The next step is to publish the animation, which means packaging it in a form your audience can play. Less often, you may export the animation, so you (or someone else) can further edit and develop it using another graphics or animation program (like Adobe Illustrator or Adobe Fireworks). In this chapter, you'll learn how to do both.

Using Flash's publishing settings (Figure 20-1), you'll see how to tell Flash to publish your animation as part of a web page, and as a standalone projector. You'll also see how to export the artwork in your animation as editable image files. But before you publish or export, you need to learn how to optimize your animation (reduce your animation's file size) so that it runs as quickly and efficiently as possible—a real concern if you're planning to publish your animation on the Web (see the box on The Importance of Being Optimized).

Flash lets you choose how to deliver your compiled animation. The options shown here produces a plain .swf that plays in most browsers. You can also publish it as a standalone projector file (a self-contained executable file you double-click to run, with no need for a web browser or a separate Flash Player), an image file, or embedded in a web page.

Figure 20-1. Flash lets you choose how to deliver your compiled animation. The options shown here produces a plain .swf that plays in most browsers. You can also publish it as a standalone projector file (a self-contained executable file you double-click to run, with no need for a web browser or a separate Flash Player), an image file, or embedded in a web page.

It's a fact of the World Wide Web—big files take longer to travel, and that creates a bottleneck for most Flash animations. The longer your audience waits, the more likely you are to lose them to another web page, a YouTube video, or a quick peek at Facebook. No one has the patience to wait for a stop-and-start animation. With that in mind, you should make every effort to keep your published .swf files small. The process is called optimization because you're seeking the optimal tradeoff between quality and file size. (If you're still tempted to skip this step, read the box on The Importance of Being Optimized.)

Ideally, you've kept file size in mind from the moment you start planning your project and throughout the entire production process. That's why there are tips scattered throughout this book about reducing file size. You can think of optimization as low-fat cooking for the animation set: The goal is to get rid of the fat without getting rid of the flavor. And, as with low-fat cooking, Flash doesn't have a single approach to optimization. Your animation may include graphics, sound, and video, and there are ways to optimize each element. On top of that, every animation and target audience is different—you need to experiment, tweak, and retest using the strategies outlined next.

Here are ten tried-and-true strategies for reducing file size. Apply as many as you can while you're developing your animation. You can use any of these techniques to trim down a completed animation. Better yet, keep them in mind as you create your next animation. That way, you'll end up with a streamlined animation without a lot of extra, after-the-fact work.

Creating a reusable symbol (Symbols and Instances) lets you add multiple instances of a shape or drawing to your animation without dramatically increasing file size. Even shrinking, rotating, or recoloring your instances costs less in file size than creating separate images. This strategy can result in big benefits.

Often bitmaps, especially photos, are expensive in terms of file size. If you can do without them, do so; if not, crop them (so that you use as little of them as possible) or optimize them by choosing a higher-than-standard compression option, as described below. However, in some cases, overly complicated vector graphics also use a lot of space. If in doubt, test both options and compare the sizes by generating a size report (Simulating Downloads).

To optimize a bitmap:

  1. Import the bitmap into your document's Library panel.

    The steps, if you need a refresher, are in Chapter 10 (Importing Graphics).

    In the Library, double-click the icon next to the imported bitmap's filename. (Or select the bitmap, and then, from the Options menu in the upper-right corner of the Library, choose Properties.)

    Either way, the Bitmap Properties window you see in Figure 20-3 appears.

  2. From the Compression drop-down list, choose either "Photo (JPEG)" or "Lossless (PNG/GIF)."

    Choose the first option if your image contains a lot of different colors or transparent effects; choose the second if it contains a few solid lumps of color. Find out more about JPEGs, PNGs, and GIFs beginning on Importing Photoshop Graphic Files.

    Flash calculates a percent compression rate and displays it near the bottom of the Bitmap Properties window.

    If you chose Photo (JPEG), you can compress the image further. Click the Custom radio button, and then type a number into the box (Figure 20-3). A value of 100 is the highest quality and the least compression.

  3. Take a look at your newly optimized image by clicking the Test button.

    The preview area shows the way the image looks using the optimization settings you chose. Near the bottom of the Bitmap Properties window, you see the percent compression rate Flash has calculated based on the Quality setting you typed in. If the image quality looks horrible, repeat step 2 with a higher quality setting; if the quality looks okay but the compression rate doesn't seem low enough, try again with a lower quality setting. (Sometimes, depending on your image, a lower quality setting will look practically identical to a slightly higher-quality setting.)

  4. When you're satisfied with the quality-vs.-file size tradeoff, click OK.

    Flash hides the Bitmap Properties window and brings you back to your workspace.

Sound clips can quickly swell your animation size, so use them sparingly. Naturally, sound effects like a bell's ding or a thunderclap use less space than a high-quality music soundtrack. A narrator's voice also takes up less space than most music. As a rule, use the shortest clips you can and compress them as much as the quality can bear. Here are the steps to optimize a sound file that's already in your Library:

  1. In the Library, double-click the icon next to the imported sound file's name.

    This icon is the quickest of three ways to open the Properties for a symbol. You can also use the Options menu in the upper-right corner of the Library panel or right-click (Control-click) a symbol.

    Either way, the Sound Properties dialog box you see in Figure 20-4 appears.

  2. Press Update, if you think the sound has been edited.

    The file may have been trimmed or changed, using an editor like Soundbooth, since it was imported.

  3. From the Compression drop-down list, choose a compression scheme.

    Flash gives you several options. Choosing the right compression scheme gives you the best size/quality optimization:

  4. As you experiment with the settings, click the Test button.

    You hear the sound file with the compression applied. Click the Stop button when you've heard enough.

  5. When you're satisfied with the quality-vs.-file size tradeoff, click OK.

    Flash hides the Sound Properties dialog box and brings you back to your workspace.

One of the options you want to make sure you set when you're ready to publish your animation is the "Compress movie" option in the Publish Settings dialog box (Publishing as a Compiled Flash (.swf) File). (Out of the box, Flash turns on this option, but do double-check that you haven't inadvertently turned it off.) Choosing this option tells Flash to squeeze your animation file as much as it can without sacrificing content. How much Flash compresses your file depends on the specific elements and effects you've included in your animation; the more text and ActionScript code your animation contains, for example, the more "bloat" Flash can squeeze out of your file.