3.15. Nudging Elements with the Keyboard

Problem

You want to move an element in small increments, or you want to move elements without the imprecision of the mouse.

Solution

Nudge selected elements with the keyboard arrow keys.

Discussion

You can reposition elements with the keyboard by selecting an element and using the keyboard arrow keys (Up, Down, Left, Right). Each time you press an arrow key, Flash moves the selected element one screen pixel. That is, at 100%, Flash moves the selected element 1 pixel each time you press an arrow key, and at 200%, Flash moves the selected element 0.5 pixels.

You can nudge elements 10 screen pixels at a time, by holding down the Shift key when you nudge.

When nudging, most Snap To constraints (Snap to Objects, Snap to Grid, and Snap to Guides) are inactive. The only exception is Snap to Pixels (View → Snapping → Snap to Pixels), a somewhat quirky feature that constrains nudging to exactly one pixel, regardless of resolution. In spite of its name, Snap to Pixels does not prevent elements from being positioned in pixel fractions (for example, an x coordinate of 215.3).

See Also

Recipe 3.11

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.