# Flash CS4 Professional in 24 Hours- P16

Chia sẻ: Cong Thanh | Ngày: | Loại File: PDF | Số trang:30

0
47
lượt xem
9

## Flash CS4 Professional in 24 Hours- P16

Mô tả tài liệu

Flash CS4 Professional in 24 Hours- P16: The creation of this book could not have happened without the skill and patience of many, many people at Sams Publishing. Most of all, I want to thank Mark Taber for offering me this opportunity and Philip Kerman for writing such a great book. I also greatly appreciate the efforts of Songlin Qiu for keeping me on track and organized, not an easy task.

Chủ đề:

Bình luận(0)

Lưu

## Nội dung Text: Flash CS4 Professional in 24 Hours- P16

2. 442 HOUR 24: Publishing a Creation ▼ TRY IT YOURSELF 3. Select File, Publish Settings, and choose both HTML and Flash. From Customize a the HTML tab, select the template Flash Only. (Leave Detect Flash Template Version unchecked.) Click OK. 4. Press F12 to use Publish Preview. Notice the square doesn’t actually reach the left edge of your browser. 5. Close the browser. Save the movie, and then close Flash. Find the file called Default.html inside the HTML configuration folder (identified in step 1), and copy and paste it. 6. Rename the copied file myDefault.html, and then open it in a text editor such as Notepad. 7. Change the first line from this: $TTFlash Only to this:$TTNo Padding This changes the template name to No Padding. You can name it what- ever you want; just be sure to retain the first three characters, \$TT, if you do rename it. 8. Change the part in the 308th line, or wherever you see the tag from this: to this: This changes all the margins to 0 pixels wide. 9. Save and close this file. Restart Flash, and open the movie you cre- ated earlier in this task. 10. Select File, Publish Settings. From the Template drop-down list on the HTML tab, select the No Padding template you just created. Click OK. 11. Press F12, and you should see a preview with no padding around the movie.
7. Deciding Which Media Types to Publish 447 FIGURE 24.4 The Flash tab of the Publish Set- tings dialog box contains all the ex- port settings for the .swf file you’re publishing. . Generate Size Report—This exports a text file that contains the same information you learned when using the Bandwidth Profiler, as dis- cussed in Hour 22, “Minimizing File Size.” Omitting Trace actions doesn’t make any difference if you play the movie in a web browser because Trace has no effect in a browser. Using ActionScript, you can send test messages to the output window when you test the movie. The output window appears while you’re authoring, so the Omit Trace Actions option is more of an authoring preference than a pub- lishing setting. . Protect From Import—This option prevents others from importing the .swf file into their own Flash files. Keep in mind that the .swf file you post on your website downloads to every user’s machine (for ex- ample, in a folder such as Temporary Internet Files in the Windows folder). The Protect From Import option has limited value. First, when someone imports a .swf file, each frame is imported as a sepa- rate keyframe. No ActionScript is retained. Second, just because some users import your file doesn’t mean they’re allowed to use it. Your .swf is by no means hack-proof. Sensitive data, such as passwords, should never reside in a movie. . Local Playback Security—This option applies only to .swf files that users download and run on their desktops, not .swf files posted on a website. When publishing, you have to choose between enabling a lo- cally run movie access to only the Internet or only local files but not both. This applies only to .swf files the user runs in Flash Player 8 or
8. 448 HOUR 24: Publishing a Creation later. Also, if you want to make an application that accesses both the Internet and the user’s hard drive, you need to make a Projector, as described in the section “Projectors” later in this hour. . Compress Movie—This option is a no-brainer. You should always leave it checked. This compression/decompression routine was added to Flash to reduce the size of .swf files. It has nothing to do with the quality settings on your raster graphics or sounds, but everything else, including your scripts, can be compressed. The Com- press Movie option is available only when you publish as Flash 6 or later because older Flash players can’t decompress these movies. The default compression for the raster graphics and audio can be globally specified in the Flash tab of the Publish Settings dialog box. You can over- ride compression settings made for individual sounds if you check the Override Sound Settings option. Finally, unlike most publishing settings, which are chosen as the last step, the choice of which version of Flash to export is one you should make early in a project. First of all, you can export Flash version 10, and your movie might play fine in the Flash 9 player; however, any new, previously unsup- ported features fails to execute and leads to unpredictable results. If you’re not taking advantage of any Flash 10–only features, your movie plays fine. If you change this setting to, say, Flash 5 and simply use Test Movie, you see a report of any unsupported features you’ve included. This feature is nice because it enables you to fix these problems. However, better than fix- ing problems after they’re created, you can set the Flash Version option as the first step in a project. This way, as you build, all the unsupported ac- tions appear in yellow (refer to Figure 24.3). Publishing HTML Files Although the HTML tab of the Publish Settings dialog box has been dis- cussed several times already, there’s additional information in it that you find valuable (see Figure 24.5). Every setting in this tab (except for Device Fonts) affects only the HTML file. You can always open the HTML file in a text editor and make edits manually. If nothing else, the Publish Settings di- alog box gives you a way to learn all the HTML settings that are available. To learn them, all you need to do is look at the corresponding HTML files created.
9. Deciding Which Media Types to Publish 449 FIGURE 24.5 The HTML tab of the Publish Set- tings dialog box contains a number of options, including which HTML template you want to use. Normally, users can right-click (or Control+click on the Mac) your movie to display a menu like the one shown in Figure 24.6. Only a minimized ver- sion of this menu appears for users if you deselect Display Menu in the Playback section of the HTML tab. The menu isn’t actually removed; it’s just shorter than usual. Keep in mind the Debugger line appears only for users who happen to have Flash installed. FIGURE 24.6 The menu that appears when a user right-clicks your movie, as shown on the left, can be reduced to the version on the right. The Windows Mode setting applies only to movies viewed in Windows and through Internet Explorer version 4 or later. Although this applies to a large audience, it is limited. Also, the other settings in this drop-down list— Opaque Windowless and Transparent Windowless—affect only HTML pages that have elements in layers. As if this weren’t enough, the perform- ance drops for these options. Feel free to explore these options, but we rec- ommend leaving the default, Window.
10. 450 HOUR 24: Publishing a Creation Publishing GIF, JPG, and PNG Files JPG and PNG are both static image formats. GIF has a sister format called animated GIF that is an animation format. All three of these formats have their own unique attributes. GIF files always have 256 or fewer discrete col- ors and tend to be most appropriate for geometric images. JPG is best for photographic or continuous-tone images. JPG can also withstand signifi- cant compression with acceptable quality loss. PNG is a high-quality image format that enables additional types of information to be included. For ex- ample, a PNG file created in Fireworks has additional options, such as lay- ers and shadow effects. When you want to export the best-quality image, PNG is a good choice—just don’t expect a small file size. When it comes to web delivery, your decision for static images is primarily between JPG and GIF, despite some browsers supporting PNG. The ques- tion about which static format to use arises only when you attempt to de- liver an alternative image to users who don’t have the Flash Player. The party line these days is usually that the users need the Flash Player; other- wise, they can’t see the site. When you do want to provide an alternative to users who don’t have the Flash Player (as you did in the task “Address Users Without Flash”), you need to decide between JPG and GIF. This decision is based on the nature of the image. Remember, it’s not the whole movie that’s used; it’s only one frame of the movie that you get to use for such static formats. Flash, by de- fault, uses the first frame of your movie for any static image format. The movie’s first frame, though, could be entirely black. To specify a different frame, you open the Frame panel and create a label in the chosen frame called #static. It’s best to insert a new layer and then a keyframe exactly where you want this label, as shown in Figure 24.7, but this is a relatively simple way to tell Flash which frame to export. After you decide which frame to use, you can decide between GIF or JPG. Remember, photorealistic images are best in JPG format, and geometric shapes are best in GIF format. PNG might seem like a useless format because the files are large and some browsers don’t support them, but there is some value. PNG is a great image format to import, as you saw in Hour 3, “Importing Graphics into Flash,” but here we’re talking about exporting. If you want to export the highest quality possible, you should use PNG. There might be several reasons to do this. For instance, even though the options available for exporting a GIF file from Flash are extensive, previewing the effects of every slight change is a
11. Deciding Which Media Types to Publish 451 FIGURE 24.7 Labeling a frame with #static tells Flash you want this frame in- stead of Frame 1 to be used when publishing a static image. tedious process of trial and error. You have to make a change, publish, and then view the results. Frankly, there are better tools for creating GIF and JPG files. Adobe Fireworks, for example, enables you to change all the out- put options for a GIF file while watching the image quality change (see Figure 24.8). This fact alone might make the extra steps you’re about to learn worth the effort. For the most control over the GIF file you’re creating, first use Flash to export a 24-bit PNG file. (The export options for PNG are shown in Figure 24.9.) Then open that PNG file in another image-editing tool, such as Fireworks, and export the GIF file. You can still use Flash’s Publish feature to create the GIF and HTML files, but you replace the GIF file Flash creates with one you create using a more suitable tool. The choice between JPG and GIF might be moot if you want to supply ani- mation to users who don’t have the Flash Player. Only GIF has the Ani- mated Playback option (see Figure 24.10). You have several options when creating an animated GIF. Most are self-explanatory. However, you don’t notice an option to specify the first and last frames. Flash uses the first and last frames of your movie. To override this, label the frame you want to be used first as #first and the last frame as #last. Also, you can enable Flash to create the HTML image map to be used with your static or animated GIF. Flash creates that image map with all the clickable areas based on all the buttons that happen to be onscreen in the last frame of your movie. How- ever, you might not have any buttons in the last frame. Just as you can specify which frame is used for static images, you can specify for which frame you want the onscreen buttons to be used in the creation of the image map. Label the frame #map. That’s it.
12. 452 HOUR 24: Publishing a Creation FIGURE 24.8 Fireworks is a much better tool than Flash for creating static graph- ics such as JPGs. FIGURE 24.9 Exporting a PNG file gives you the best-quality static image. Projectors If you put your .swf file in a web page, users just need the Flash Player to view it. When you installed Flash, it installed the Flash Player, so you can simply double-click any .swf file on your computer, and it runs. If you
13. Deciding Which Media Types to Publish 453 want to send this file to someone (that is, you don’t want to publish it in a web page), you can. The only catch is the user has to have the Flash Player installed. FIGURE 24.10 Of all the traditionally static image formats, only GIF provides the Ani- mated option. Alternatively, you can create a projector, which is a standalone executable. Think of a projector as a modified version of the Flash Player that plays only the .swf file you specify. One way to make a standalone projector is to open a .swf file with the Flash Player (just double-click a .swf file on your computer). Select File, Create a Projector, and then name the file you would like to create. That’s all there is to it. One catch is that your .swf file grows by nearly 3MB when you convert it to a projector. That’s the size of the Flash Player, which you’re including in the projector. The other catch is that the projector you just made runs only on the platform you’re using (Win- dows or Mac). .swf files work on any platform because the user already has the Flash Player unique to that platform installed. Because projectors have the platform-specific player built in, they can be played only on that platform. To create a projector for whichever platform you’re not using—Windows or Mac—you could repeat the steps listed on a computer using the target plat- form. However, you don’t have to do this. From the Formats tab of the Pub- lish Settings dialog box, you can specify for which platforms you want the projector made (see Figure 24.11). The projector file that Flash creates can be sent to whomever you want.
14. 454 HOUR 24: Publishing a Creation FIGURE 24.11 Standalone projectors can be ex- ported when you publish for both Windows and Mac. NOTE Better Projectors If you’re using a lot of projectors or just want some added fea- tures, a few other options in- clude several third-party “.swf to .exe” tools. Here’s a list of a few: mProjector: www.screentime. com/software/mprojector/ Screenweaver: www.screenweaver.com Projectors provide a nice way to use Flash for standalone applications. For SWFStudio: www.northcode.com example, you might be making a presentation to an audience and want to Zinc: www.multidmedia.com use Flash to create the slides. Obviously, you can add a lot of spice to your Finally, coming soon from presentations. The action fscommand is designed for this purpose. The pa- Adobe, a desktop application- rameters for fscommand include fullscreen, quit, and many others. For ex- creation tool codenamed Apollo ample, you can put the action fscommand (“fullscreen”, “true”) in the first gives you another projector op- frame to make your projector fill the screen. Then, in the last frame, you can tion. place a button with the action fscommand (“quit”) as a way to exit. Although it is more difficult to distribute projectors than to simply post to a website, projectors work great for presentations. Many people create port- folios of their work that they distribute via CD-ROM. For example, they can include lots of uncompressed audio and high-quality images, and there are no download issues. But, if you use the fullscreen option of fscommand, you need to give your users an obvious Quit button, too. QuickTime You can export a QuickTime video that includes Flash. Don’t confuse this with how you imported QuickTime video in Hour 19. There you exported a .swf that just happened to include video. The Publish Settings QuickTime option enables you to create a QuickTime video that requires the Quick- Time player.
15. Exporting Other Media Types 455 Although it’s kind of cool how you can add a Flash layer including interac- tivity to a QuickTime video, the fact is Flash video has improved so much that there’s little reason to do so. In addition, you’re limited to the feature set of Flash 5 or earlier. Exporting Other Media Types Believe it or not, Flash can export even more media types than those listed in the Publish Settings dialog box. Select File, Export, Export Movie, and you see a list under the Save as Type drop-down list that’s quite long (see Figure 24.12). In addition to the formats listed in the Publish Settings dialog box, you might see others that interest you. The following sections cover two formats you might find particularly useful: AVI and image sequences. FIGURE 24.12 All the formats Flash can export (in- cluding those found in the Publish Settings dialog box) are listed in the Export Movie dialog box. Publishing AVI Files AVI is another digital video format. It’s available only by selecting File, Export, Export Movie, and then choosing AVI from the Save as Type drop- down list in the Export Movie dialog box. Because it’s similar to the limits of QuickTime, you should avoid AVI. In fact, with so many limits when ex- porting AVIs, you often get better results simply doing a screen capture while your .swf plays. TechSmith’s Camtasia software works great for this (www.camtasia.com). Publishing Image Sequences Image Sequences is another option that is available only in the Export Movie dialog box. A bitmap sequence, for example, exports a static BMP file of each frame in your movie. Several sequence formats are available (re- fer to Figure 24.12). They’re all basically the same; only the file format
16. 456 HOUR 24: Publishing a Creation varies. The process is the same for each format. You select File, Export, Ex- port Movie, select the file format from the Export Movie dialog box, and then name the file. The name you give is used only as the prefix. For exam- ple, if you name the file myMovie, the filename containing Frame 1 is called myMovie0001.bmp (or whatever file extension matches the type you’re ex- porting). After you name the file and click Save, you are shown a dialog box in which you can specify the details for the selected file type. It’s sort of a mini-version of the Publish tab. For bitmap sequences, you have to specify details for bitmaps, for example. You might intend to create an animation in another software package that can import sequences of static images. For example, if you have an ani- mated GIF-creation tool, you could import a sequence of high-quality bitmaps that Flash exported. You could also use the static images from a QuickTime video inside Flash. Because you can’t actually use QuickTime video in a .swf file, you could first import a QuickTime video into Flash, export a sequence of high-quality BMP files, delete the QuickTime video from your Flash file, and import the BMP files into Flash. What’s really con- venient is the numbered BMP files that Flash created upon export are im- ported sequentially and placed in separate keyframes, thus saving you what would otherwise be a painstaking task of importing many individual frames. Similarly to exporting AVI files, when you export image sequences, you can’t use movie clips; they just don’t animate. Obviously, audio doesn’t have any effect either because you’re exporting images only. This might seem like the least likely use for Flash; however, you should realize that anytime you see something that looks like video in Flash, you’re probably watching a sequence of static images. Summary This hour discussed all the common ways to export Flash movies. Other, less traditional applications, such as using projectors, static images, Quick- Time video, and image sequences, were also discussed. For the traditional .swf in HTML option, Publish gives you a nice interface to select options, and then Flash actually creates the files for you. Templates can include code to optionally supply users with an alternative image. Also,