Sampling and Switching Fills and Strokes


You can always use the Selection tool to select a stroke or fill so that you can delete, move, or modify it using any of the Swatches pop-ups or the Stroke Style menu on the Property inspector. But, what do you do if you want to add a stroke or fill to a shape that was drawn without one or the other? The answer to this dilemma is found in a trio of tools that work nimbly together to provide one of the most unique graphics-editing solutions found in Flash. You use the Eyedropper tool to acquire fill and stroke styles or colors, and use the Paint Bucket and Ink Bottle tools to transfer these characteristics to other shapes.

Note 

These tools will only apply changes directly to shapes or Drawing Objects, so to modify an element that has been grouped or converted into a symbol, you must first access the element in Edit mode.

The Eyedropper Tool

As we introduced in Chapter 7, "Applying Color," the dropper icon that appears when you use the Selection tool to select colors from any of the pop-up Swatches menus is similar to the Eyedropper tool available in the Tools panel. However, when pulled out of the Tools panel directly, the Eyedropper tool (I) has slightly different behavior. Although you cannot use the Eyedropper tool to sample colors from elements outside the Document window, you can use it to sample line and fill styles or to simultaneously change the stroke and the fill color chips to the same sampled color.

Note 

When used to acquire colors, the Color swatches panel Eyedropper tool is limited to acquiring colors from swatches within the panel. However, the droppers that you access from the Swatches pop-ups in the Color Mixer panel, Tools panel, or Property inspector can acquire colors from other visible areas, such as the system background, items on the desktop, or items that are open in other applications. The only "trick" to this is to press and hold the mouse over any of the color chips and only release the mouse when you are hovering over the color that you want to sample. The preview in the Swatches pop-up changes as you roll over different colors, and the color chip changes when you release the mouse to load the color that you have selected.

Cross-Reference 

For more information about this feat, refer to Chapter 7, "Applying Color."

The Eyedropper tool doesn't have any options in the Tools panel because they are all built in. As you hover over an item, the Eyedropper tool displays a small icon to indicate whether it is over a line or a fill that can be sampled by clicking. When a line is sampled, the Eyedropper tool automatically converts to the Ink Bottle tool, and when a fill is sampled, the Eyedropper tool converts to the Paint Bucket tool.

The composite image shown in Figure 9-1 shows the icons displayed when you use the Eyedropper tool to sample a fill (A) and apply it to another shape with the Paint Bucket tool (B), and sample a stroke (C) and apply it to another shape with the Ink Bottle tool (D).

image from book
Figure 9-1: The Eyedropper tool used to sample a fill and apply it with the Paint Bucket tool (A, B) and to sample a stroke and apply it with the Ink Bottle tool (C, D)

Any items already selected when the Eyedropper tool samples a stroke or fill will immediately acquire the applicable stroke or fill style. This is the quickest way to transfer the fill or line styles of one element to a whole group of elements. Figure 9-2 shows the Eyedropper tool used to sample a fill with one (A) or more (B) elements already selected.

image from book
Figure 9-2: The Eyedropper tool also instantly converts selected elements to the sampled fill or stroke style.

Note 

When you hold down the Shift key while clicking a line or stroke color with the Eyedropper tool, the Fill and the Stroke color chips will both be converted simultaneously to the newly selected color so that it can be applied with any of the other drawing tools.

The Ink Bottle Tool

You use the Ink Bottle tool (S) — refer to Figure 9-1 (D) — to change the color, style, and thickness of existing outlines. It is most often used in conjunction with the Eyedropper tool. When the Ink Bottle tool is in use, pay attention to the following three options:

  • The current Stroke Color option on the Tools panel or the Property inspector

  • The Line Height option of the Property inspector

  • The Stroke Style option of the Property inspector

The Ink Bottle will apply the current stroke color and line style, either sampled with the Eyedropper tool or chosen from the pop-up in the Tools panel or the controls in the Property inspector.

Caution 

When you click to sample a line with the Ink Bottle tool, all other currently selected lines are changed simultaneously.

The Ink Bottle tool is especially useful for applying custom line styles to multiple lines. You can build a collection of custom line styles either off Stage or in a special custom line palette that is saved as a single-frame Flash movie. You can then acquire these line styles whenever you want to reuse them.

Tip 

You can add Flash files with Graphics libraries that you plan to reuse to the application's Libraries folder so that they will be easily accessible from the Window ð Common Libraries menu.

Caution 

Depending on the level of zoom, some lines may not display accurately on the screen — though they will print correctly on a high-resolution printer. You may adjust Stroke Height (or thickness) in the Stroke Style dialog box that is invoked when you choose the Custom stroke style option in the Property inspector.

The Paint Bucket Tool

You use the Paint Bucket tool to fill enclosed areas with color, gradients, or bitmap fills. Although the Paint Bucket tool is a more robust tool than the Ink Bottle tool, and it can be used independently, it's most often used in conjunction with the Eyedropper tool. As we discussed earlier in this chapter, when the Eyedropper tool picks up a fill, it first acquires the attributes of that fill and then automatically changes itself to the Paint Bucket tool. When the Paint Bucket tool is active, as shown in Figure 9-3, two options are available from the Tools panel: Lock Fill and Gap size. The Gap size drop-down menu offers four settings to control how Flash handles gaps or open spaces in lines when filling with the Paint Bucket tool.

image from book
Figure 9-3: The Paint Bucket tool and Gap size options

When you use the Eyedropper tool to acquire a fill that is a broken-apart bitmap, the Eyedropper tool is automatically swapped for the Paint Bucket tool and a thumbnail of the bitmap image appears in place of the fill color chip. This procedure also automatically engages the Paint Bucket Lock Fill option.

The final appearance of a bitmap fill can vary greatly depending on how you apply it. Figure 9-4 shows a series of shapes all filled with the same bitmap to illustrate the various results achieved from using different steps to define the fill.

image from book
Figure 9-4: (A) A shape filled with the Paint Bucket using a bitmap fill sampled with the Eyedropper or selected in the Mixer panel; (B) a shape drawn with the Rectangle tool using a bitmap fill selected in the Mixer panel or applied after the shape was drawn using the Selection tool and Mixer panel fill style menu; (C) a broken apart bitmap sampled with the Eyedropper tool and then applied to the finished shape using the Paint Bucket tool; (D) a shape filled with the Paint Bucket tool, using a color sampled from the bitmap with the Swatches color dropper tool

Caution 

Using the Paint Bucket to fill with white (or the background color) is not the same as erasing. Painting with white (or the background color) may appear to accomplish something similar to erasing. However, you are, in fact, creating a filled item that can be selected, moved, deleted, or reshaped. Only erasing erases!

Another behavior of the Paint Bucket tool that can be helpful to recognize is that the exact location where you click to apply the Paint Bucket tool defines the highlight point for the fill. This has no visible effect when filling with solid colors, but when filling with gradients it will affect how the fill is rendered within the boundaries of the shape. Figure 9-5 illustrates how the highlight of a gradient fill varies based on where it was "dumped" with the Paint Bucket.

image from book
Figure 9-5: The highlight location of gradient fills can be defined by the position of the Paint Bucket tool when the fill is applied to a shape.

Tip 

You can also adjust the highlight and the center point of the rendered gradient with the Gradient Transform tool after a shape is filled.

As with the Ink Bottle tool, the Paint Bucket tool can be especially useful for applying custom fill styles to multiple items. You can build a collection of custom fill styles either off-screen (on the Pasteboard) or in a special, saved, custom-fills-palette, single-frame Flash movie. You can then acquire these fills whenever necessary.

Caution 

If you click with the Paint Bucket tool on one of several selected fills, all of the selected fills will be simultaneously changed to the new fill.

Using the Paint Bucket Gap Size Option

As shown in Figure 9-3, the Gap size option drop-down offers four settings that control how the Paint Bucket treats gaps when filling. These settings are Don't Close Gaps, Close Small Gaps, Close Medium Gaps, and Close Large Gaps. These tolerance settings enable Flash to fill an outline if the endpoints of the outline aren't completely joined, leaving an open shape. If the gaps are too large, you may have to close them manually with another drawing tool. Figure 9-6 illustrates how the Gap size option settings affect the Paint Bucket fill behavior.

image from book
Figure 9-6: Paint Bucket fill applied with various Gap size settings— (A) original oval outline with decreasing gap sizes, left to right, with no fill; (B) gray fill applied with Don't Close Gaps; (C) gray fill applied with Close Small Gaps; (D) gray fill applied with Close Medium Gaps; (E) gray fill applied with Close Large Gaps

Tip 

The level of zoom changes the apparent size of gaps. Although the actual size of gaps is unaffected by zoom, the Paint Bucket's interpretation of the gap is dependent upon the current Zoom setting. When zoomed in very close, the Paint Bucket tool will find it harder to close gaps; when zoomed out, the Paint Bucket tool will find it easier to close gaps.

Using the Paint Bucket Lock Fill Option

The Paint Bucket's Lock Fill option is the same as the Brush Lock Fill option — it controls how Flash handles areas filled with gradient color or bitmaps. When this button is turned on, all areas (or shapes) painted with the same gradient or bitmap appear to be part of a single, continuous, filled shape. The Lock Fill option locks the angle, size, and point of origin of the current fill to remain constant throughout any number of selected shapes. Modifications made to the fill in one of the shapes will be applied to the other shapes filled using the same Lock Fill option.

Cross-Reference 

Working with gradient colors is discussed in Chapter 7, "Applying Color."

To demonstrate the distinction between fills applied with or without the Lock Fill option, we created five shapes and filled them with a bitmap with Lock Fill off. As shown in Figure 9-7, on the left, the image was rendered separately from one shape to the next. On the right, those same shapes were filled with the same bitmap, but with Lock Fill on. Note how the image is now continuous from one shape to the next. Bitmap fills are automatically tiled to fill a shape, so the bitmap fill on the right was also scaled using the Gradient Transform tool to make it easier to see the continuation of the image between the various shapes.

image from book
Figure 9-7: Fill applied with Lock Fill turned off (left), compared with fill applied with Lock Fill turned on and then scaled using the Gradient Transform tool (right)

Note 

When you use the Eyedropper tool to pick up a fill or gradient from the scene, the Lock Fill button is automatically toggled on.

Caution 

If the shapes you are filling with the Paint Bucket tool were created with the Object Drawing option turned on, you will be able to use the Lock Fill option to get a fill that continues from one shape to the next, but when you try to adjust the fill with the Gradient Transform tool, you will find that the fills are transformed individually instead of as a group. The workaround for this glitch is to use raw shapes when you apply a locked fill that you plan to transform. If you started with Drawing Objects, use the Break Apart command before you try to use the Gradient Transform tool to adjust a continuous fill on multiple shapes.




Macromedia Flash 8 Bible
Macromedia Flash8 Bible
ISBN: 0471746762
EAN: 2147483647
Year: 2006
Pages: 395

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