1.2. Drawing Curved Lines

Problem

You want to draw curved lines.

Solution

Use the Pen tool. Optionally, use the Line tool to draw a straight line. Then use the Selection tool to make the line curve. To draw curves freehand, use the Pencil tool with smoothing.

Discussion

Flash offers a number of approaches to drawing curved lines. Which you select is a matter of both context and preference.

If you plan to draw a series of connected curved segments, the Pen tool is frequently the best option. The Pen tool, as discussed briefly in Recipe 1.1, enables you to draw line segments by plotting points. However, as you draw the points, you can adjust the control points in order to draw curved segments. To adjust the control points, click the mouse at the location at which you want to add a point, and then drag while the mouse button is still pressed. You can also use the Subselection tool to adjust any of the end points and control points along a path after it has been drawn.

You can also use the Selection tool to make paths drawn with the Line tool (or any technique that results in a straight line) into curved segments. The following steps describe the procedure:

  1. Draw a straight line using any of the techniques described in Recipe 1.1.

  2. Choose the Selection tool.

  3. Make sure that the straight line is deselected. If the line has already been selected before proceeding to the next step, you will cause the line to move, rather than curve.

  4. Use the mouse (or stylus) to click on a point along the line and drag it to form a curve. You may repeat this step as many times as you want to add more curves to the line.

Although it is the least accurate of the approaches, drawing curved lines with the Pencil tool is often the most straightforward. Furthermore, using the Pencil tool you can achieve sketched looks that would be more difficult to achieve with the other approaches described in this section. Here’s how to draw curved lines with the Pencil tool:

  1. Select the Pencil tool (Y) from the Tools panel.

  2. In the Tool panel options, set the Pencil Mode to Smooth.

  3. Press and drag with the mouse to draw the curve. Flash smoothes the line automatically.

The Smooth Pencil Mode causes Flash to remove the bumps that usually appear when drawing with a freehand drawing tool. In addition to Smooth, Flash also has two other Pencil Modes: Straighten and Ink. Pencil Modes are discussed in Recipe 1.17. You can further smooth a curved line by selecting it with the Selection tool and choosing Modify → Smooth, as discussed in Recipe 1.18.

Although it is unlikely that you will have cause to use it frequently, there is at least one additional technique for drawing curves. When you want to draw a curve that is an arc of an ellipse (an oval or circle), you can achieve the effect most effectively by drawing the entire ellipse using the Oval tool, and then delete the portion of the ellipse that is unnecessary.

Get Flash 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.