1.3. Merging and Stacking Shapes
So far, you've been using Flash's default Merge Drawing mode. In this mode shapes can interact with one another, merging together when they overlap. For example, if the corners of two squares overlap, the frontmost shape will "knock out" the underlying shape, effectively deleting it, as seen in the top of Figure 1-10. This behavior contrasts with that of the newly introduced Object Drawing mode, which will be discussed shortly.
Figure 1-10. Merge Drawing mode (top) and Object Drawing mode (bottom) compared
What are the implications of shapes merging? If you didn't save your work at the end of the last sequence, do so now, and then try this with your current file:
At first you may think this is a problem, but it can be very useful, and you can prevent it from happening, if you wish. First, however, look at a few simple examples of how Merge Drawing mode can be advantageous. If you recently saved your work, feel free to experiment.
Select the Line tool and draw a line all the way through your artwork, from outside left to outside right. (This is arbitrary, but ensures that the line goes completely through the box and protrudes on either side.) Now choose the Selection tool and click once in various regions of your art. You'll see that the line has effectively segmented your art, allowing easy selection of smaller pieces.
Next, select the Brush tool. This will show you a good example of how unprotected shapes can be altered in creative ways. In the tool's Options area, experiment with the different Paint modes. Paint Normal will behave the way you likely expect. Paint Fills, however, will paint only fills, leaving strokes unaffected. Try Paint Behind and Paint Inside to see how they work, too.
Finally, try one last thing. Select the Lasso tool, and freely select any combination of fill and stroke. With a selection active, you can move it, or delete it, as before. The Merge Drawing mode and the Lasso tool make selecting partial fills and strokes very easy and natural.
When you don't want shapes to merge together, there are a few ways to prevent this from happening. In just a few minutes, you'll learn how to convert shapes into another type of Flash asset. Also, in Chapter 3 you'll learn how to add new layers to prevent shapes from ever touching each other. However, you still need to know how to protect existing shapes in the same layer. The first approach you'll practice is making a group from a shape:
Traditionally, you probably think of a group as two or more items treated as a single entity, and the same is certainly true in Flash. However, as you've just seen, a group in Flash has another important purpose. By grouping the parts of a shape, you ensure that the shape can no longer be altered by another shape. Thus, grouping single items is an attractive solution to unwanted shape merging.
1.3.2. Editing groups
What if you want to edit a shape that has been grouped? Although the shapes no longer seem editable, there are two ways to satisfy this need.
First, if you double-click a group, the surrounding assets will appear to dim, and the group will become editable. This is because you are effectively "inside" the group and can edit it as if it were a shape. When you are finished editing, you can double-click elsewhere on the Stage to go back "outside" the group. This is useful when you want the shape to continue to be protected from interaction with other shapes.
Note: When inside a group, if you look at the very top of the main document window (to the right of the word "Timeline"), you will see a series of icons from left to right that represent a nested hierarchy of objects that you are editing. The last one will likely say "Group," indicating where you are. You will read about this in greater detail later in this book, but for now bear in mind that if you ever get stuck and don't know what you're editing, you can look to this area and click icons to the left until you've walked your way back to where you want to be.
Second, if you break apart a group, it will return to behaving like a shape. To do this, first select the group and then access the Modify Break Apart menu command (Ctrl/Cmd-B). Be sure you want to do this, though, because it means that other overlapping shapes will again affect the shape.
Both of these techniques are very useful and can be applied to many different types of Flash assets. You'll see them again when you look at other types of native Flash assets, such as buttons, but they apply to other editable items as well. For example, if you break apart a block of text, the selection will turn into a group of individual letters. If you again use the Break Apart command, those letters will turn into shapesthey will not be editable as text, but can be fully manipulated as shapes.
Think of breaking apart assets as "going down to the next smallest editable item." This will become clearer with more practice.
1.3.3. Gradients Transformed
Now that you know about groups, you can prevent existing shapes from being deformed by other shapes. But you still have a big hole in your gradient background that needs repair. Here's how to fix it:
1.3.4. Object Drawing Mode
You've already learned how to protect a shape from merging with other shapes by grouping it, but there's a faster way to achieve this result as you are drawing. The Object Drawing mode, introduced in Flash 8, essentially draws shapes that are "pre-grouped." (The results are actually called drawing objects, but the effect is the same.)
Add a couple of stars to your illustration to practice:
1.3.5. Stacking Graphics
The image's composition is good, but not great. The silhouette looks a bit odd on top of the stroke for the box. If you fix that, the stroke will appear as a frame for the entire image: