Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 50 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
50
Dung lượng
1,63 MB
Nội dung
GRAPHICS IN FLASHCS5 129 Figure 2-66. A traced bitmap is on the right, and the original image is on the left. If you have used previous versions of Flash, you will find the Preview button in the Trace Bitmap dialog box a welcome addition to Flash CS5. 4. Click OK to apply the change and close the dialog box. 5. Now you’ll see what happens when you use even closer tolerances. Select the image on the right of the stage, and open the Trace Bitmap dialog box. Specify these values: Color threshold: 5 Minimum area: 2 Corner threshold: Many corners Curve fit: Pixels 6. Click the Preview button. The progress bar will take a bit longer this time, and when it finishes, the difference between the original image and the vector image is not readily evident. Click OK to apply the changes. You are about to find out that there is indeed a major difference between the original bitmap and the traced image. The difference becomes evident when you optimize the image. Let’s get real clear on one aspect of tracing: Flash should be your last resort. Illustrator CS5’s Live Trace feature is far superior and more accurate. www.zshareall.com Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. CHAPTER 2 130 Optimizing the drawing In Flash, optimizing a drawing means you are reducing the number of corners in a traced image and smoothing out the lines in the traced image to give you a smaller and less-precise image. Though you can optimize any drawing you have in Flash, this technique is best applied to traced images. Here’s how: 1. Change to the Selection tool, and marquee the image you traced. Select Modify ➤ Shape ➤ Optimize to open the Optimize Curves dialog box shown in Figure 2-67. Figure 2-67. The Optimize Curves dialog box lets you reduce the size of a traced image. 2. Drag the Smoothing slider up to the Maximum value of 100, and click OK. The process starts, and when it finishes, you will be presented with an Alert box telling you how many curves have been optimized (see Figure 2-68). The downside is the image loses a lot of its precision, and some of the curves become spiky because Flash converted all the pixelated smoothness to vectors. If you repeat the process on the second image but only move the Smoothing slider to the midpoint, the process will take a lot longer than the previous one, and the curve reduction will be minimal. This is because you essentially created a high-resolution vector image, so there are a lot more curves to check out. The bottom line here is the decision regarding using a bitmap, tracing it, and optimizing the curves is up to you. This book was purchased by flashfast1@gmail.com www.zshareall.com Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. GRAPHICS IN FLASHCS5 131 Figure 2-68. A 26 percent curve reduction means a hefty file size reduction. JPEG files and Flash The JPG/JPEG file format is the one used for photos. As mentioned earlier, JPEG stands for Joint Photographic Experts Group and is a method of compressing an image using areas of contiguous color. The file size reductions can be significant with minimal to moderate image quality loss. This explains why this format has become a de facto imaging format for digital media. In this exercise, you are going to learn how to optimize a JPEG image in Flash. Before you do this, it is extremely important you understand that the JPEG format is lossy. This means each time a JPEG image is compressed in the JPEG format, the image quality degrades. The point here is you have to make a decision regarding JPEG images before they arrive in Flash. Will the compression be done in Photoshop or Fireworks, or will Flash handle the chores? If the answer is Flash, always set the JPG Quality slider in Photoshop or Fireworks to 100 percent to apply minimal compression. If you don’t know where the image came from or what compression was used, don’t let Flash handle the compression. 1. Open the JPGCompression.fla file in your Chapter 2 Exercise folder. When it opens, you will notice the movie contains nothing more than a single JPEG image, and the stage matches the image dimensions. In short, there is no wasted space that can skew the results of this experiment. www.zshareall.com Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. CHAPTER 2 132 2. Minimize Flash, and open the Chapter 2 Exercise folder. Inside the folder is a file named JPGCompression.swf. It is the compiled version of the FLA file, and if you check its file size, you will see it comes in at about 176KB. Let’s see whether we can shed some weight from this file. 3. Return to Flash, and save the open Flash file to your Exercise folder by selecting File ➤ Save As and naming the file JPGCompression2.fla. 4. Double-click the image in the Library to open the Bitmap Properties dialog box shown in Figure 2-69. Be aware that any changes made in this dialog box ripple through the entire movie and will override the defaults used in the Publish dialog box. Figure 2-69. The Bitmap Properties dialog box Let’s examine this dialog box. To start, the image on the left side is the preview image. As you start playing with some of the settings, this image will show you the final result of your choices. This is a good thing because changes you make in this dialog box are visible only when the SWF file is running; they won’t be reflected in the image on the stage. The other areas are as follows: Name: This is the name of the file. If you want to rename the file, select it and enter a new name. This only changes the name by which Flash knows the file—it does not “reach outside of Flash” and rename the original image. Path, date, dimensions: These are fairly self-explanatory. There will be the odd occasion where this information will not be displayed. The reason is the image was pasted in from the Clipboard. www.zshareall.com Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. GRAPHICS IN FLASHCS5 133 Update button: If you have edited the image without using the Edit with feature, clicking this button will replace the image with the new version. This button will not work if you have saved or moved the original image to a new location on the computer. To “reconnect” such a broken link, respecify the image file’s location with the Import button, explained next. Import button: Click this, and you open the Import Bitmap dialog box. When using this button, the new file will replace the image in the Library, and all instances of that image in your movie will also be updated. Allow smoothing option: Think of this as anti-aliasing applied to an image. This feature tends to blur an image, so use it judiciously. Where it really shines is when it is applied to low-resolution images because it reduces the dreaded jaggies. Compression drop-down menu: This allows you to change the image compression to either Photo (JPEG) or Lossless (PNG/GIF). Use Photo (JPEG) for photographs and Lossless (PNG/GIF) for images with simple shapes and few colors, such as line art or logos. To help you wrap your mind around this, the image in the dialog box uses Photo (JPEG) compression, and if you click the Test button, the file size is about 2.4KB. Apply Lossless compression and click the Test button, and the file size rockets up to 142KB. Use Imported JPEG data option: Select this check box if the image has already been compressed or if you aren’t sure whether compression has been applied. Selecting this avoids the nasty results of applying double compression to an image. Quality option: If you deselect the Use Imported JPEG data check box, you can apply your own compression settings. In fact, let’s try it. 5. Make sure your compression setting is Photo (JPEG) and that you have deselected the Use Imported JPEG Data check box. Change the Quality value to 10 percent, and click the Test button. The image in the preview area, shown in Figure 2-70, is just plain awful. The good news is the file size, at the bottom of the dialog box, is 4.6 KB. Figure 2-70. At 10 percent quality, the image is terrible. www.zshareall.com Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. CHAPTER 2 134 6. Change the Quality setting to 40 percent, and click the Test button. Things are a little better, but the text in the banner a bit looks pixelated, and the file size has gone up to 16KB. 7. Change the Quality value to the normal 80 percent value used by imaging applications, and click the Test button. The text issue is resolved, but the file size has risen to 43.1KB. As you are seeing, there is an intimate relationship between the Quality setting and file size. 8. Knowing the quality between 50 percent and 80 percent is a vast improvement; let’s see if we can maintain quality but reduce the file size. Set the Quality value to 65 percent, and click the Test button. The difference between 65 percent and 80 percent is minimal, but the file size has reduced to 3KB. Click OK to apply this setting and close the dialog box. 9. Save the movie, and press Ctrl+Enter (Windows) or Cmd+Return (Mac) to test the movie. This will create the SWF you need. Minimize Flash and the SWF window, and navigate to your Exercise folder. The results are, to say the least, dramatic. The file size, as you see in Figure 2- 71, has reduced to 29KB from 176KB. Save and close the open movie. Figure 2-71. Applying compression in Flash can result in seriously smaller and more efficient SWF files. Using GIF files in FlashCS5 There was point a few years back where many web and Flash designers were preparing to celebrate the death of the GIF image and the GIF animation. The reason was simple: in a universe where bandwidth is plentiful and every computer on the planet is able to display 16-bit color, the limited color range and small file size of a GIF image that made the format so important were irrelevant. GIF images were developed for a time of limited color depth—monitors that could only display 256 colors—and dial-up modems. Then a funny thing happened on the way to the wake; they arose from their deathbed. The reason was banner advertising. Ad agencies and their clients were discovering the Web really was a viable advertising medium and that Flash was a great interactive tool for ads. The problem was, standards for banner advertising appeared on the scene, and the agencies discovered they were handed a file size limit of 30KB. This tended to go against the grain, and as they grappled with the requirement for small files, they rediscovered the GIF image and the GIF animation. This isn’t to say you should use the GIF format only in banner ads. It can be used in quite a few situations where size, or even transparency for that matter, is a prime consideration. www.zshareall.com Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. GRAPHICS IN FLASHCS5 135 Working with GIF images Here’s how to use GIF images and GIF animations in Flash: 1. Open the GIF.fla file in your Chapter 2 Exercise folder. When the file opens, open the Library. There are two GIF files in the Library. 2. Drag the Figurines image from the Library to the stage. Notice how you can see the stage color behind the image. This image is a transparent GIF. When it comes to GIF transparency, you have to understand it is an absolute. It is either on or off. There are no shades of opacity with this format. GIFs may contain up to 256 colors, and one of those colors may be transparent. 3. Drag the FigurinesNoTrans file to the stage, and place it under the image already there. This image is a GIF image with no transparency applied. 4. Select the image you just dragged onto the stage, and press the Ctrl+B (Windows) or Cmd+B (Mac) combination to break the image apart. Hold on, that isn’t right. Only the figurines in the image break apart (see Figure 2-72). That is an expected behavior. Remember what we said in the previous step? The background in a GIF image is either on or off. If it is on, it can’t be removed in Flash. When you break apart an image like this, here’s what’s really going on. That image is simply translated into a shape with a bitmap fill. It is the same thing as drawing a shape and filling it with that bitmap. This is why file size is identical between the white and transparent versions of this image. The GIF is the same in all respects—except that the color slot in one file’s color table is white and in the other file the color table is transparent. But both GIFs have the same number of colors and weigh the same. 5. To “get rid of” the white background, you can drag in the edges of the shape that contains the white version, just like the star shape from the earlier bitmap fill example. Obviously, this would be nearly impossible by hand with an image of this complexity, but any portion of the bitmap fill can be hidden by changing the shape hat contains it. 6. Close the file, and don’t save the changes. www.zshareall.com Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. CHAPTER 2 136 Figure 2-72. Transparent and regular GIFs are treated differently in Flash. Working with GIF animations Animated GIFs are a bit different. They are a collection of static images—think of a flip book—that play, one after the other, at a set rate, all stored inside a single GIF file. These flip book “pages” can be imported either directly into the main timeline (not a good idea) or into a separate movie clip. Here’s how: 1. Open a new Flash document, and create a new movie clip named Counterforce. The Symbol Editor will open. 2. Select File ➤ Import ➤ Import to Stage, and when the Open dialog appears, locate the Counterforce.gif file, select it, and click the Open button. www.zshareall.com Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. GRAPHICS IN FLASHCS5 137 3. When the import is finished, you will see that each frame of the animation has its own Flash frame, and each image in the animation, as shown in Figure 2-73, has its own image in the Library. 4. Press the Enter key to test the animation or click the Scene 1 link to return to the main timeline, add the movie clip to the stage, and test the movie. A good habit to develop is to place the images in the Library in a folder. This way, your Library doesn’t end up looking like what your mom would call “a pigsty.” Figure 2-73. Importing GIF animations into a movie clip Importing Fireworks CS5 documents into FlashCS5 When Macromedia was acquired by Adobe in 2006, the betting in the Macromedia community was that Fireworks, Macromedia’s web imaging application, would simply not make the cut. The reason was the market regarded Fireworks as a competitor to Photoshop—it wasn’t—and, as such, the application was doomed to extinction. What the Macromedia community failed to comprehend was that Adobe, prior to the acquisition, had quietly announced it was no longer supporting ImageReady, which was the web imaging application for Photoshop. When the acquisition was settled, Fireworks did indeed make the cut, and in fact Adobe had decided to reposition Fireworks as a rapid prototyping application for web designers. Along the way, Adobe improved how Fireworks PNG files integrate with FlashCS5 along with Illustrator CS5, Flex Builder 2, and Photoshop CS5, and the movement of files from Photoshop and Illustrator into Fireworks. The end result is Flash designers now have a tool that will seriously improve their workflow. We will be showing you elsewhere in this book techniques in which Fireworks integration will be a huge timesaver. For now, though, let’s concentrate on getting a PNG image—the native file format used by Fireworks—into Flash. www.zshareall.com Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. CHAPTER 2 138 As you can see in Figure 2-74, the Fireworks file we will be working with is composed of one layer, Background, and three sublayers. When you import this PNG image into Flash, you will see these layers move, intact, into the movie. Figure 2-74. We start with a Fireworks CS5 PNG image. To import the PNG image, follow these steps: 1. Open a new Flash document. When the New Document dialog box opens, click the Templates button, select Advertising from the Category list, and select 728 x 90 Leaderboard from the Template list, as shown in Figure 2-75. Click OK to open the template. Figure 2-75. Opening a FlashCS5 template 2. Select File ➤ Import to Library, and navigate to the Banner.png image in the Chapter 2 Exercise folder. www.zshareall.com Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. [...]... watermark CHAPTER 2 Importing Photoshop CS5 documents into FlashCS5 We’ll wind up this overview of Flash s drawing features with the import of Photoshop CS5 images into Flash As you saw with Illustrator CS5, the process has been streamlined, and you are in for a rather pleasant surprise Follow these steps to import a Photoshop document into Flash: 1 Open a new Flash document When the document opens,... Compare the Flash file (shown in Figure 2-77) to the This book was purchased by flashfast1@gmail.com Fireworks file in Figure 2-74 You can now either save the file or close it without saving the changes Figure 2-77 The Flash movie clip layers match those in the Fireworks PNG image Importing Illustrator CS5 documents into Flash CS5Flash lets you import Illustrator AI files directly into Flash and generally... drop shadow Figure 2-78 The Illustrator CS5 file for this example contains a number of layers and paths The authors would like to thank Mischa Plocek for the use of the Mascot.ai file Mischa is a flash developer/artist based in Zurich, Switzerland, and his work can be seen at www.styleterrorist.com Follow these steps to import an Illustrator CS5 document into Flash CS5: 141 www.zshareall.com Please purchase... is a CMYK image, do the CMYKto-RGB conversion in Illustrator before importing the file into Flash To preserve drop shadow, inner glow, outer glow, and Gaussian blur in Flash CS5, import the object to which these filters are applied as a Flash movie clip In Flash, these filters can be applied only to movie clips Let’s import an Illustrator CS5 drawing to see what is causing all of the joy The file we... provides settings to apply to AI files being pasted onto the Flash stage 140 www.zshareall.com Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark GRAPHICS IN FLASHCS5 To many Flash designers, that list is “nirvana,” but there are two critical aspects of the Flash- to-Illustrator workflow that must be kept in mind: Flash supports only the RGB color space If the Illustrator image... piece of the artwork when it is in Flash The Illustrator file importer also provides you with a great degree of control in determining how your Illustrator artwork is imported into FlashFor example, you can now specify which layers and paths in the Illustrator document will be imported into Flash and even have the Illustrator file be converted to a Flash movie clip The Flash Illustrator file importer... fills The various color features in Flash and how to create and save a custom color How to trace a bitmap in Flash How to import and optimize graphics in Flash How to use the new Illustrator and Photoshop file importers in Flash CS5 149 www.zshareall.com Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark CHAPTER 2 This book was purchased by flashfast1@gmail.com We aren’t going... location for the symbol’s registration point The registration point (also known as the transformation or pivot point) is used for alignment with other objects on the stage and for movement along a motion guide or for objects put into motion using ActionScript 153 www.zshareall.com Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark CHAPTER 3 Folder: This was new to Flash CS4... by 146 When the file imports, the Flash stage will be resized to the dimensions of the Photoshop document 146 www.zshareall.com Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark GRAPHICS IN FLASH CS5 The manner in which PSD files are imported into Flash is set in the Preferences You can reach them by selecting Edit ➤ Preferences (Windows) or Flash ➤ Preferences (Mac) and selecting... www.verypdf.com to remove this watermark GRAPHICS IN FLASH CS5 2 Select the remaining layers, not the paths, and select Create movie clip, as shown in Figure 2-80 Don’t bother with instance names because there is no need for ActionScript here The Convert layers to drop-down menu allows you to convert your Illustrator layers to Flash layers or to a series of Flash keyframes (this is handy if they are animated) . Photoshop CS5 documents into Flash CS5 We’ll wind up this overview of Flash s drawing features with the import of Photoshop CS5 images into Flash. As you. changes. Figure 2-77. The Flash movie clip layers match those in the Fireworks PNG image. Importing Illustrator CS5 documents into Flash CS5 Flash lets you import