TextField._yscale Property | Flash 6 |
height of a text field, as a percentage | read/write |
The floating-point _yscale property specifies the height of theField's bounding box relative to its original height, expressed as a percentage. The original height is either the height of the field at authoring time or the height most recently specified via either MovieClip.createTextField( ) or _height.
When the current height of theField is the same as its original height, _yscale is 100. A _yscale of 200 doubles theField's height relative to its original height. A _yscale of 50 halves theField's height relative to its original height. Changes to _yscale are reflected by _height.
The size of text in the field is also affected by _yscale, but it is always scaled proportionately (in relatively equal horizontal and vertical percentages) to prevent distortion. This contrasts with _xscale, which affects theField's text scale only when embedFonts is true and can scale text disproportionately. Though _yscale can change the size of text, the change is not reflected by the TextFormat object returned by getTextFormat( ). For precise control over text size, use the TextFormat object's size property instead of TextField._yscale.
When _yscale is set to a negative value and embedFonts is true, theField is flipped vertically, as if across a horizontal mirror running through its top border (i.e., it becomes a mirror image of itself), after which the negative value is treated as a positive. To flip a text field vertically without resizing it, set _yscale to -_yscale (negative _yscale).
The following code increases theField_txt's height by 500 percent:
this.createTextField("theField_txt", 1, 0, 0, 200, 20); theField_txt.border = true; theField_txt.text = "This is five times as high."; theField_txt._yscale = 500; // To maintain the proportions of the original bounding box, // we can set _xscale to match _yscale: theField_txt._xscale = 500;
MovieClip._yscale, TextField._height, TextField._xscale, the TextFormat class