Recipe 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




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