Форум Flasher.ru

Форум Flasher.ru (http://www.flasher.ru/forum/index.php)
-   Flex (http://www.flasher.ru/forum/forumdisplay.php?f=84)
-   -   Прокрутка TextArea (http://www.flasher.ru/forum/showthread.php?t=87374)

RadiationX 03.11.2006 17:46

Прокрутка TextArea
 
Как заставить TextArea автоматически прокручивать скролл вниз при добавлении текста?

etc 03.11.2006 18:07

my_txt.scroll = my_txt.maxscroll после добавления текста.

А, нет, щас посмотрю.

etc 03.11.2006 18:22

Код:

<?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

Спасибо!


Часовой пояс GMT +4, время: 19:14.

Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.