Recipe 1.10. Drawing Primitive Shapes


Problem

You want to draw primitive shapes, such as ovals, circles, rectangles, and squares.

Solution

Use the Oval (O) and Rectangle (R) tools, or the Pencil (Y) tool.

Discussion

To create ovals or rectangles, select the Oval or Rectangle tool from the Tools panel, and click and drag across the stage to create the bounds of the shape. Because they are closed shapes, ovals and rectangles are automatically filled with the default fill style.

Fills are not visible if View Outlines mode is active. To view fills, switch to another mode, such as View Antialias.


Set the fill style to No Color to create unfilled shapes. To create an unfilled shape regardless of the default fill style, use the Pencil tool to scribble your best approximation of a rectangle or oval. Flash will automatically convert a rough approximation to a perfect rectangle or oval, especially if the Recognize Shapes optionunder Edit Preferences Drawingis set to Tolerant. The Recognize Shapes option works only if you draw the shape in one continuous motion without releasing the mouse button or lifting the pen from the tablet until youve closed the shape. Also note that the only shapes that Flash can recognize with the Pencil tool are primitive shapesovals, rectangles, and triangles. It cannot recognize polygons with sides numbering anything greater than four. To draw regular polygons ( polygons with equilateral sides) you'll need to use the PolyStar tool as discussed in Recipe 1.11.

In Flash's drawing paradigm, a shape is created with a series of points, not treated as a separate primitive object (the Oval and Rectangle tools create shapes with at least four points).Selecting any point along the curve, by using the Subselection tool (A), allows you to distort the original shape.

To create a perfect circle or square with the Oval or Rectangle tool, use shift-con-straint; that is, hold down the Shift key as you drag.

When using the Rectangle tool, you have the option of drawing a rectangle with rounded corners. You can set the corner radius in the Options section of the Tools panel by clicking the Set Corner Radius icon. In the dialog box that displays, specify the radius in pixels.

See Also

Recipe 1.4




Flash 8 Cookbook
Flash 8 Cookbook (Cookbooks (OReilly))
ISBN: 0596102402
EAN: 2147483647
Year: 2007
Pages: 336
Authors: Joey Lott

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