Recipe 7.6. Resizing Text Fields (Stretching the Text)


Problem

You want to stretch a text field horizontally and/or vertically such that its text is also stretched.

Solution

Select the text field on the stage, and modify the height and width values in the Property inspector. Or, use the Free Transform tool.

Discussion

There are two different kinds of resizing that you can perform on textresizing the bounding box (which does not affect the width of the text within the text field) or resizing the width and height of the entire text field, including the text within it. The latter of these two types of resizing can make the text appear as though you have stretched (or squished) it.

You can accomplish this stretching effect by selecting the text on the stage and then modifying the height and width properties in the Property inspector or using the Free Transform tool.

This technique works only for embedded fonts. Because static text uses embedded fonts by default, you can stretch and squish it without any additional steps. If you want to use this technique with dynamic or input text fields, then you need to make sure that you are embedding the fonts. Also, this technique can be applied only at authoring time.

Note that even though static text fields use embedded fonts by default, it is possible to use device fonts with static text fields if you select _sans, _serif, or _typewriter as the font face (see Recipe 7.9). If you use device fonts with any text fieldeven static textyou cannot scale the text field such that the fonts are stretched or squished.





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