Using the Pen Tool: Straight Lines

I l @ ve RuBoard

With most Flash tools, the math goes on behind the scenes. You draw a line or a shape, and Flash takes care of placing points that define the line segments and curves that make up that shape. The pen tool brings the process to center stage. The pen tool lets you place defining points (called anchor points ) and adjust the curvature of the lines connecting them (using controllers called Bzier handles ). You learn more about curves and handles in the following section of this chapter and in Chapter 3.

The path the series of points and connecting lines created by the pen tool is the skeleton of your object. When you've completed a path, Flash fleshes it out by applying a stroke to it.

For the following exercises, set the pen tool to show previews as you create your path. Choose Edit > Preferences (Mac OS 9 and Windows) or Flash > Preferences (Mac OS X) to open the Preferences dialog box, select the Editing tab, and check the Show Pen Preview checkbox (Figure 2.33).

Figure 2.33. In its default mode, Flash's pen tool previews a curve segment only after you place both of the curve's defining anchor points. For these exercises, choose Edit > Preferences (Mac OS 9 and Windows) or Flash > Preferences (Mac OS X), select the Editing tab, and check the Show Pen Preview checkbox. This setting allows you to preview the curve as you position the pointer before clicking to set the second defining anchor point.

graphics/02fig33.gif

To draw straight-line segments with the pen tool:

  1. In the Toolbox, select the pen tool, or press P (Figure 2.34).

    Figure 2.34. Select the pen tool to create paths.

    graphics/02fig34.gif

  2. Set the stroke attributes for your path.

  3. Move the pointer over the Stage.

    The pen tool appears with a small x next to it (Figure 2.35). The x indicates that you are ready to place the first point of a path.

    Figure 2.35. The x next to the pen tool indicates that you are about to start a new path. Click to place the first anchor point.

    graphics/02fig35.gif

  4. Click where you want your line segment to begin.

    The pointer changes to a hollow arrowhead ; a small circle indicates the location of the anchor point on the Stage.

  5. Reposition the pen tool where you want your line segment to end.

    Flash extends a preview of the line segment from the first point to the tip of the pen as you move around the Stage.

  6. Click.

    Flash completes the line segment, using the selected stroke attributes. The anchor points appear as solid squares (Figure 2.36).

    Figure 2.36. Flash previews points as you place them (top) and it adds a stroke to the path as soon as you complete a segment (bottom).

    graphics/02fig36.gif

  7. Repeat steps 5 and 6 to draw a series of connected line segments.

To end an open path:

To end a line segment or series of segments, do one of the following:

  • Double-click the last point in your path.

  • In the Toolbox, click the pen tool (or any other tool).

  • From the Edit menu, choose Deselect All, or press graphics/01icon01.gif -Shift-A (Mac) or Ctrl-Shift-A (Windows).

  • On the Stage, graphics/01icon01.gif -click (Mac) or Ctrl-click (Windows) away from your path.

To create a closed path:

  1. With the pen tool selected, click three areas on the Stage to place three anchor points in a triangular layout.

    Flash completes two legs of your triangle with strokes.

  2. Position the pointer over your first anchor point.

    Flash previews a line segment for the third side of the triangle. A small hollow circle appears next to the pen tool (Figure 2.37).

    Figure 2.37. To close a path, position the pen tool over an existing anchor point (top). A circle next to the pen tool indicates that you are directly on top of the path. Click to complete the path (bottom).

    graphics/02fig37.gif

  3. Click.

    Flash closes the shape, adding a stroke to the triangle's third side and filling the triangle with the currently selected fill color .

  4. Move the pointer away from your anchor points.

    A small x appears next to the pen tool, indicating that you are free to place the first anchor point of a new path.

graphics/01icon02.gif Tip

  • You can close a path anywhere along a line (or curve) segment. Position the pen over the path between anchor points. (A small circle appears next to the pen tool.) Click, and Flash closes the path, creating a stroke with no fill. To close the path and fill the resulting shape, double-click just inside the path (Figure 2.38).

    Figure 2.38. You can close a path by clicking between anchor points. Click once directly on the path (top) to create just a stroke (middle). Double-click just inside the path to create a filled closed shape (bottom).

    graphics/02fig38.gif


I l @ ve RuBoard


Macromedia Flash MX for Windows and Macintosh. Visual QuickStart Guide
Macromedia Flash MX 2004 for Windows and Macintosh (Visual QuickStart Guides)
ISBN: 0582851165
EAN: 2147483647
Year: 2002
Pages: 243

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