Choosing a Drawing Mode

If you're new to Flash, here's a tip that will save you hours of frustration. Write these words on a sticky note on your monitor: Flash has two drawing modesmerge mode and object mode. When drawings don't behave as expected, I'm suffering from mode confusion.

Lines and shapes drawn in merge mode behave differently from those drawn in object mode. This phenomenon becomes apparent when you try to move drawings around the screen or arrange them in front of or behind other graphics. You use a simple toggle button or shortcut key to change from one mode to the other. Keep in mind that you can use both drawing modes in a single Flash document, and there's a good chance you'll want to work that way. You can even have graphics drawn in merge mode in the same layer and frame as graphics drawn in object mode. Both types of graphics retain their native characteristics and eccentricities unless you purposely convert them to the other format.

Note

Want to check out the differences between the two modes? The Missing CD (www.missingmanuals.com/cds) has two example files. 02-1_Merge_Drawing_Mode.fla shows an oval and a rectangle drawn in merge drawing mode. 02-2_Object_Drawing_Mode.fla shows a similar oval and rectangle drawn in object mode.

Originally, Flash offered only merge mode. It's unlike drawing tools you find in most programs, but merge mode works great for web animations because it keeps file sizes small and animations fast. Flash assumes you want to use the merge drawing mode unless you tell it otherwise. Graphics drawn in merge mode are called shapes. In this mode, if one shape overlaps another shape, Flash erases the hidden portion of the bottom shape underneath—a fact you discover when you move the overlapping shape, as shown in Figure 2-8 (bottom). Many Flash veterans love merge mode, because they can draw quickly, using overlapping shapes like cookie cutters.

Out of the box, Flash assumes you want to work in merge drawing mode, so you don't have to do anything special to activate it the first time you use Flash. But if you (or someone you share your copy of Flash with) has activated object drawing mode, then you need to toggle it back to merge mode. In the following steps, you'll learn how to make sure you're in merge mode and discover some of its idiosyncrasies.

  1. In the Tools panel, click the Rectangle tool (or press the R key).

    When the Rectangle tool is selected, the Options section at the bottom of the Tools panel displays the Object Drawing icon (Figure 2-9 left). If the icon (a circle in a square) appears pressed-down, then you're in object drawing mode and need to switch back to merge drawing mode.

  2. If necessary, click the Object Drawing button (or press J) to deselect object mode.

    When the Object Drawing button is deselected, you're in merge mode.

  3. Draw a rectangle on the stage.

    You can set the stroke and fill however you want before you draw the rectangle.

  4. Select the Oval tool (O) and then change the fill and stroke color. Set the stroke height to about 3 or 4 pixels.

    If you need a refresher on setting the stroke and fill properties, see Drawing a Shape.

  5. Draw an oval that partially overlaps the rectangle, as shown at the top of Figure 2-8.

    The oval is drawn on top of the rectangle. In general, Flash places the most recently drawn graphic on top of previous graphics; however, there are some gotchas when you mix and match merge and object graphics.

  6. With the Selection tool (V), click the middle of the oval.

    The fill portion of the oval displays a dotted highlight. When you see a dotted highlight like this, it's a signal that the graphic was drawn in merge mode. And, sure enough, the Properties panel identifies the selection as a Shape.

  7. Drag the oval away from the rectangle.

    As you drag, the fill moves away from the rectangle, leaving the empty stage beneath. When shapes drawn in merge mode overlap, the bottom shape is erased. Notice that the stroke portion of the oval remains behind. A single click on the fill selects only the fill portion of the oval. If you want to select the fill and the stroke, then double-click the fill. There are more tips on using the Selection tool on Selecting Objects on the Stage.

The object drawing mode tells Flash to think of shapes the way most humans naturally think of them: as individual, coherent objects. Overlapping shapes in object mode doesn't erase anything, and when you select a shape, you select the entire shape—not just the fill, or line, or portion of the shape you selected. If you've used Adobe Illustrator or the drawing tools in Microsoft Office, this drawing mode will seem familiar. To get a feeling for object mode characteristics, repeat the steps that begin on Merge Drawing Mode. In step 2, toggle object drawing mode on by making sure the Object Drawing button is depressed, as shown at left in Figure 2-9. As you draw, your shapes look similar to the ones drawn in merge mode. However, when you select the oval in step 6, you won't notice the dotted selection pattern. Instead, you see a rectangular outline around the oval, as shown bottom right in Figure 2-9. That's the object mode's way to show that an object is selected. The words "Drawing object" at the top of the Properties panel are another clue that you selected an object mode graphic.

You can use merge mode shapes and object mode graphics together in the same Flash document. Here are a few tips that will make life with mixed graphics a little easier:

Once you draw a line or a shape on your stage, you need to select it if you want to do anything else to it—for example, if you want to change its color, make it bigger, move it, or delete it.

As you can see in Figure 2-11, the Tools panel has three tools that let you select an object on the stage—Selection, Subselection, and Lasso. How these tools behave depends on whether you've created your drawings in merge or object drawing mode (see the previous section).

The Subselection tool lets you reposition the individual points that define and control your strokes and fills. These points are called anchor points, and the connecting lines are called segments.

In Flash, a cigar isn't just a cigar. A circle isn't even just a circle. As explained earlier, every drawing you create using Flash's drawing and painting tools is composed of strokes and fills. As shown in Figure 2-12, you create strokes and fills with a variety of drawing tools:

In a lot of cases, your shapes comprise both strokes and fills. You can create fill- and stroke-containing shapes in one fell swoop using Flash's shape tools—Oval, Rectangle, and PolyStar. If you draw a shape by hand using the Pen, Pencil, or Line tools, then you need to manually add a fill if you want one using the Paint Bucket tool. That process is described on Changing the Color of a Fill.

Why the emphasis on the technical terms "stroke" and "fill" when all you want to do is draw a smiley face? For one very important reason: Flash treats strokes and fills differently. You use different tools to create them and different tools to modify them. If you don't know the difference between a stroke and a fill, you won't be able to do a whole lot with the drawing and painting tools described in this chapter.