Working with Compound Shapes


If you used older versions of Flash or you have been drawing and modifying artwork in Flash 8 with the Object Drawing option turned off, you've probably noticed that Flash has a unique way of handling lines and fills that reside on the same layer of your document. Items that are the same color merge, whereas items that are a different color replace or cut out other items where they overlap. Flash treats lines or strokes as separate items than fills, so these can be selected and moved or modified independently of each other, even if they are the same color. Figure 9-40 shows how Flash allows lines and fills to be selected individually, even if they are the same color.

image from book
Figure 9-40: A gray oval fill with a gray stroke may not appear to have a discrete outline, but Flash allows these two elements to be selected separately.

Tip 

By double-clicking an element, you can select all the related segments. This works for selecting the stroke and fill of a shape or for selecting connected sections of a segmented line (such as the four sides of a rectangle).

Both lines and fills are divided into segments at points of intersection. Figure 9-41 shows a fill split into two independent shapes by drawing a line on top of it (top) or modified by merging with a fill of the same color and being cut out by a fill of a different color (bottom).

image from book
Figure 9-41: A fill split by an overlapping line drawn on the same layer (top). Two fills of the same color merge into a compound shape when they intersect on the same layer (bottom).

These behaviors can be destructive or helpful to your artwork, depending on how you manage individual elements. The key point to remember is that primitive shapes cannot be overlapped on the same layer while deselected without affecting each other. If items are grouped or converted into Drawing objects or symbols, they remain independent and will not be compounded or deleted by intersection with other items. Items on layers are also autonomous and will not merge with or erase items that exist on other layers.

You can move lines or fills over other primitive shapes without affecting them, as long as they remain selected — as soon as they are deselected, they will intersect or merge with adjacent primitive shapes on the same layer. Figure 9-42 illustrates the process of moving a selected shape over and then off of another shape while keeping the two shapes independent (top), and the result if the shape is deselected while it is overlapping another shape, before being reselected and moved, to create a compound shape (bottom).

image from book
Figure 9-42: A shape moved across another shape while being continuously selected (top) compared to a shape that is deselected while on top of another shape, and then reselected and moved (bottom)




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