0 Replies Latest reply on Nov 18, 2006 3:41 PM by GMFlash

    Make TextArea height adjust to fit content

    GMFlash
      I'm trying to get my TextArea to resize and fit the content it contains but for some reason the following code causes it to become about 3x higher than the text it contains. Can someone point out what I am doing wrong? Thanks!

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
      <mx:TextArea width="400">
      <mx:text>
      this is a test this is a test this is a test this is a test this is a test
      this is a test this is a test this is a test this is a test this is a test
      this is a test this is a test this is a test this is a test this is a test
      this is a test this is a test this is a test this is a test this is a test
      this is a test this is a test this is a test this is a test this is a test
      </mx:text>
      <mx:creationComplete>
      event.target.height = event.target.textHeight;
      </mx:creationComplete>
      </mx:TextArea>
      </mx:Application>