2 Replies Latest reply on Sep 21, 2011 6:51 AM by r4raghs

    dynamically resizing TextArea ?!?!?! I cant see what I am typing

    r4raghs Level 1

      http://cookbooks.adobe.com/post_Creating_a_dynamically_resizing_TextAr ea_without_s-13628.html

      used code in above link, additionally I added code for width similar to height,

      the else part in below

       

      override public function set width(value:Number):void

      {

          if(condition)

          {

       

          }

          else

          {

                        textField.validateNow();

                          if (textField.textWidth+7<= this.maxWidth)

                              super.width=textField.textWidth+7;

                          else

                          {

                              this.wordWrap =true;

                              super.width = super.maxWidth;

                          }

       

          }

      }

      also I set wordWrap=false in adjustHeightHandler and constructor. when I continue typing it reaches maxWidth then maxHeight after that i cant see what I am typing.

      live scrolling reaches maximum height, but I could see by press down arrow

        • 1. Re: dynamically resizing TextArea ?!?!?! I cant see what I am typing
          Arun Ganesh Level 3

          Hope the following code will help u,

           

          public function CustomTextArea()

                  {

                      super();

                      this.addEventListener(KeyboardEvent.KEY_DOWN,onKeyDown);

                  }

                              private function onKeyDown(keyEvt:KeyboardEvent):void{

                                        updateDisplayList(unscaledWidth,unscaledHeight);

           

                              }

                  override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void

                  {

                      super.updateDisplayList(unscaledWidth, unscaledHeight);

                      this.height = this.textField.textHeight+10;

                      this.textField.scrollV = 0

                  }

          1 person found this helpful
          • 2. Re: dynamically resizing TextArea ?!?!?! I cant see what I am typing
            r4raghs Level 1

            Works when maxHeight reaches first, If it reaches maxWidth then maxHeight the existing issue continues. (I wont type enter, it wraps automatically)

             

            Thanks for your valuable time.