3.13. Laying Out Page Elements Proportionately

Problem

You want to design or lay out elements proportionately, precisely, and/or harmoniously.

Solution

Use any combination of the grid, guides, and rulers.

Discussion

For certain kinds of informal art, you can get away with positioning elements by dragging and dropping them into place; a few pixels to the left or right won’t make any difference. But for certain types of files, such as technical illustrations or designs based on classical architecture, layout must be precise and proportionate. Flash offers several tools to assist you in pixel-perfect layouts.

One useful tool is the grid, which covers the stage with rectangles, like graph paper. You can set the size of the rectangles using any unit of measurement—for example, every 12 pixels, or half-inch, or whole centimeter. You can toggle snap constraints on or off as well, which makes it easier to create proportionately sized and spaced elements.

To toggle the grid on or off, choose View → Grid → Show Grid. The grid appears on the stage. If you export the movie, the grid will not appear in the SWF; it is an authoring aid only.

By default, the grid comprises squares, 18 pixels (or 0.25 inches) wide. You can change the size of the width and height of the rectangles, within limits. You cannot set a side to less than 7.2 pixels (0.1 inch), or more than 288 pixels (4 inches). To change the size of the grid, enter a new width and height in the Grid dialog, accessed by selecting View → Grid → ...

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.