
Код:
<?xml version="1.0"?>
<!-- Simple example to demonstrate the TextArea control. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init()">
<mx:Script>
<![CDATA[
import flash.events.MouseEvent;
private function init():void {
this.addEventListener(MouseEvent.CLICK,this.clickHandler);
}
private function clickHandler(event:MouseEvent):void {
this.area.text+='\nNew line';
this.area.validateNow();
this.area.verticalScrollPosition = this.area.textHeight;
}
]]>
</mx:Script>
<mx:Panel title="TextArea Control Example" height="75%" width="75%"
paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10">
<mx:TextArea width="200" height="100" id="area">
<mx:text>
This is a multiline, editable TextArea control. If you need
a non-editable multiline control, use the Text control.
</mx:text>
</mx:TextArea>
</mx:Panel>
</mx:Application>