Category Archives: TextArea (Spark)

Styling the text selection format on a Spark TextArea control in Flex 4

The following example shows how you can style the text selection format on a Spark TextArea control in Flex 4 by setting the focusedSelectionFormat property on the TextFlow’s interactionManager to a new SelectionFormat object.

Continue reading Styling the text selection format on a Spark TextArea control in Flex 4

Changing the background color of a disabled Spark TextArea control in Flex 4

In a previous example, “Changing the background color of a disabled TextArea control in Flex”, we saw how you can change the background color of a disabled MX TextArea control by setting the use the backgroundDisabledColor style.

The following example shows how you can change the background color of a disabled Spark TextArea control in Flex 4 by setting the contentBackgroundColor style in the disabled skin state.

Continue reading Changing the background color of a disabled Spark TextArea control in Flex 4

Programmatically scrolling the Spark TextArea control in Flex 4

The following example shows how you can programmatically scroll the Spark TextArea control in Flex 4 by setting the vertical scroll position on the horizontal and vertical scroll bars in the scroller, horizontalScrollBar, and verticalScrollBar skin parts.

Continue reading Programmatically scrolling the Spark TextArea control in Flex 4

Setting a gradient background fill on a Spark TextArea control in Flex 4

In a previous example, “Setting a gradient background fill on a Halo TextArea control in Flex 4”, we saw how you could create a linear gradient background on a Halo/MX TextArea control in Flex 4 by creating a custom border skin with a LinearGradient fill and setting the borderSkin style.

The following example shows how you can create a linear gradient background on a Spark TextArea control in Flex 4 by modifying the background fill in the TextArea control’s skin to a LinearGradient.

Full code after the jump.

Continue reading Setting a gradient background fill on a Spark TextArea control in Flex 4

Inserting and appending text into a Spark TextArea control in Flex 4

The following example shows how you can insert and append text into a Spark TextArea control in Flex 4 by using the insertText() and appendText() methods.

appendText() — Appends the specified text to the end of the RichEditableText, as if you had clicked at the end and typed it. When RichEditableText supports vertical scrolling, it will scroll to ensure that the last line of the inserted text is visible.
insertText() — Inserts the specified text as if you had typed it. If a range was selected, the new text replaces the selected text; if there was an insertion point, the new text is inserted there, otherwise the text is appended to the text that is there. An insertion point is then set after the new text.

Full code after the jump.

Continue reading Inserting and appending text into a Spark TextArea control in Flex 4

Auto-scrolling a Spark TextArea control in Flex 4

In a previous example, “Auto-scrolling a TextArea control in Flex”, we saw how you could auto-scroll a Flex Halo TextArea control when new content is added by setting the verticalScrollPosition property to the value of the maxVerticalScrollPosition property.

The following example shows how you can auto-scroll a Flex 4 Spark TextArea control using the appendText() method.

Full code after the jump.

Continue reading Auto-scrolling a Spark TextArea control in Flex 4