2 Replies Latest reply on Jun 6, 2008 9:10 AM by Gregory Lafrance

    Textarea format

    Fredsells
      I've got a renderer based on textarea that diplays plain text with embedded newlines. The linespacing is much to great. I saw how to set leading using mxml, but I need to do it within actionscript (I think) because that's where my renderer is defined. All this is so I can have my row height vary based on the amount of text. my code for the renderer follows , can anyone help???

        • 1. Re: Textarea format
          matthew horn Level 3
          Just a shot in the dark here, but did you try calling setStyle("leading", val)? leading is a style property so it can't be set with a simple setter.

          hth,
          matt horn
          flex docs
          • 2. Re: Textarea format
            Gregory Lafrance Level 6
            danger42 is correct. Simply example:

            <?xml version="1.0"?>
            <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" creationComplete="init()">
            <mx:Script>
            <![CDATA[
            private function init():void{
            txtArea.setStyle("leading",7);
            }
            ]]>
            </mx:Script>
            <mx:TextArea width="200" height="100" text="Leading not set on this text. The rain in Spain falls primarily on the plains."/>
            <mx:TextArea width="200" height="100" id="txtArea" text="Leading set in ActionScript. The rain in Spain falls primarily on the plains."/>
            <mx:TextArea width="200" height="100" leading="20" text="Leading set in MXML. The rain in Spain falls primarily on the plains."/>
            </mx:Application>