Table of Contents

TextField._height Property Flash 6

height of the text field's bounding box, in pixels read/write
theField._height

Description

Every text field defines a rectangular region, known as its bounding box, inside which text is displayed. The floating-point _height property is a nonnegative number specifying the height of a field's bounding box, in pixels. By changing _height, we resize a field's bounding box, allowing it to display more or less text. Changing a field's _height doesn't change the height of the text it contains; to change text size, set the TextFormat.size or TextField._yscale properties. To check the height of a field's text, use textHeight. Note that as of Flash 6, the autoSize property can be used to force a text field's bounding box to fit its text.

Changes made to a clip's height in the authoring tool or via _yscale are reflected by _height. To apply a stroke or a fill to a field's bounding box, use the border and background properties.

Example

// Create a 10-pixel-high text field 
// (with a border so we can see its bounding box)
this.createTextField("theField_txt", 1, 0, 0, 150, 10);
theField_txt.border = true;
// Assign the field some text for display
theField_txt.text = "Almost time for breakfast.";
// Make theField_txt 20 pixels high
theField_txt._height = 20;
// Add 15 pixels to theField_txt's height
theField_txt._height += 15;

See Also

TextField.autoSize, TextField.textHeight, TextField._width, TextField._yscale, the TextFormat class


Table of Contents