You can transform a TextArea
component horizontally and vertically while authoring and at run
time. While authoring, select the component on the Stage and use
the Free Transform tool or any of the Modify > Transform
commands. At run time, use the
setSize()
method
or any applicable properties, such as
height
,
width
,
scaleX
and
scaleY
of
the TextArea class.
When a TextArea component is resized, the border is resized to
the new bounding box. Scroll bars are placed on the bottom and right
edges if they are required. The text area is then resized within
the remaining area; there are no fixed-size elements in a TextArea
component. If the width of the TextArea component is too narrow
to display the size of the text, the text is clipped.
Styles and the TextArea component
The TextArea component’s
styles specify values for its skins, padding, and text format when
the component is drawn. The
texFormat
and
disabledTextFormat
styles
govern the style of the text that the TextArea displays. For more
information about skin style properties, see
Use skins with the TextArea component
.
The following example sets the
disabledTextFormat
style
to change the appearance of text when the TextArea is disabled but
the same process applies to setting the
textFormat
style
for an enabled TextArea.
Create a new Flash file.
Drag a TextArea component to the Stage and give it an instance
name of
myTa
.
Add the following code to the Actions panel on Frame 1 of
the main Timeline.