Просмотр полной версии : Прокрутка TextArea
RadiationX
03.11.2006, 17:46
Как заставить TextArea автоматически прокручивать скролл вниз при добавлении текста?
my_txt.scroll = my_txt.maxscroll после добавления текста.
А, нет, щас посмотрю.
<?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>
RadiationX
03.11.2006, 19:26
Спасибо!
Работает на vBulletin ® версия 3.7.3. Copyright ©2000-2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Copyright © 1999-2008 Flasher.ru. All rights reserved.