Recipe 7.7. Setting Margins, Indentation, and Leading


Problem

You want to adjust the margins, indentation, and the leading (the space between lines of text).

Solution

Select the text you want to modify, and adjust the values in the Format Options dialog box.

Discussion

You can modify line spacing, indentation, and right and left margin values from the Format Options dialog box, which is accessible from the Property inspector by clicking on the Format button. First, you should select the text on the stage that you want to modify. If you want to affect all the text contained within a text field, use the Selection tool to select the entire text field. If you want to modify the values for a single line within the text field, use the Text tool to place the cursor within the appropriate line of text. It does not matter whether you place the cursor at the beginning, end, or middle of the line, or even if you choose to highlight the entire line of text. Margin and leading changes affect the entire line of text.

With a text field or a line of text within it selected, open the Format Options dialog box. Then, adjust the values either by entering a new value with the keyboard or by adjusting the sliders using the mouse.

Flash uses pixels for units of measurement for text margins and indentation. The valid range for both right and left margins is between 0 and 720 pixels. The default value is 0, and that means that the text is flush with the right and/or left boundary of the text field. Indentation, however, has a valid range of720 to 720, with a default of 0. Indentation is applied to the first line in a text field and to each line immediately after a hard return. An indentation is relative to the left margin and can never be less than the left boundary of the text field. For example, if the left margin is set to 12 and the indentation is set to 12, the indented lines will appear 12 pixels to the right of the non-indented lines, or 24 pixels to the right of the left boundary. If the left margin is set to 12 and the indentation is set to6, the indented lines start at 6 pixels to the left of the non-indented lines, or 6 pixels to the right of the left boundary. However, if the left margin is set to 12, and the indentation is set to24, the indented lines will appear 12 pixels to the left of the non-indented lines, or flush with the left boundary of the text field.

Flash calculates line spacing differently from margins. Instead of measuring in pixels, Flash uses points for these calculations. The difference is that whereas pixels are an absolute measurement (a pixel is always the same size), points are relative to font size. The same point value translates into more or less actual space when the font size changes. Line spacing is measured from line descender to line ascenderthose are the imaginary lines that border each line of text on the top and bottom. The default line-spacing value of 0 means that the descender of the top line is touching the ascender of the subsequent line of text. However, because these imaginary lines have thickness, the actual text does not touch with a value of 0. Negative line-spacing values bring the lines of text closer, and positive line-spacing values move the lines of text further apart. Be mindful, as using too small a value will cause your lines of text to overlap.

Note that the margin, indentation, and leading settings work reliably only for text with embedded font outlines. If you use device fonts or font family groups (_sans, _serif, or _typewriter), the settings will not work reliably.




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