How to set variable length of a TextArea?


i set width of textarea , have length automatically adjust amount of text put in it, avoiding insertion of scrollbar.

i've been unable find question answered in either documentation or forum archives.

 

i read somewhere if set width absolute number , omitted height, job, doesn't. gives me textarea 2 lines high scrollbar. (and, i'd prefer use widths percents, if possible).

 

here sample code using absolute heights:

 

<?xml version="1.0" encoding="utf-8"?>
<mx:application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationcomplete="loadxml()" >

<mx:script>     <![cdata[
         [bindable]
         var xmldata:xml;
        var urlloader = new urlloader();

private function loadxml():void
    {    urlloader.addeventlistener(event.complete,onxmlloaded); urlloader.load(new  urlrequest("../data/paralog.xml"));    }

function onxmlloaded(e:event):void{  xmldata =  new xml(e.target.data); }
     ]]> </mx:script>
          
    <mx:panel title="{xmldata.title.tostring()}" height="400" width="600" layout="vertical"
        horizontalalign="center" status="status area" >

 

    <mx:textarea width="200"
        htmltext="{xmldata.detail.docket.tostring()
        + '&lt;br&gt;' + xmldata.detail.date.tostring()}"
        />

 

    <mx:vbox width="500" borderstyle="solid" paddingtop="10" paddingbottom="10" paddingleft="10" paddingright="10"   >
         <mx:textarea width="200" editable="false"  text="{'question:' + xmldata.issue.(@id=='i1').question.tostring()}"/>
        <mx:hbox width="550" >
             <mx:textarea width="200" editable="false"  text="{xmldata.*.claim.(@id=='i1y').statement.tostring()}"/>
             <mx:textarea width="200" editable="false"  text="{xmldata.*.claim.(@id=='i1n1').statement.tostring()}"/>
        </mx:hbox>
    </mx:vbox>
     </mx:panel>  

</mx:application>

 

fyi, here's xml i'm reading in:

<?xml version="1.0"?>
<case>
<title>district of columbia et al. v. heller</title>
<detail>
<docket>u.s. supreme court no. 07-290</docket>
<date>2008-06-26</date>
<syllabus>07-290.sy.html</syllabus>
<decision author="as">mu-07-290.op.as.html</decision>
<dissent author="js">mu-07-290.di.js.html</dissent>
<dissent author="sb">mu-07-290.di.sb.html</dissent>
</detail>

<issue id="i1">
    <question>
    2d amendment protect individual right possess usable handgun , use traditionally lawful purposes, such self-defense within home? 
    </question>
    <claim id="i1y" author="as" textat="07-290.as#s18, 07-290.as#s625"
                    supportedby="(i1yg1)" >
        <statement holding="true">yes. 2d amendment protects individual right possess firearms , [district of columbia]'s total ban on handguns, requirement firearms in home kept nonfunctional when necessary self-defense, violated right.</statement>
    </claim>
    <claim id="i1n1" author="js" textat="07-290.js#getthis" opposedby="(i1n1g1)">
        <statement>no. prefatory clause demonstrates 2d amendment protects right possess , carry firearm in connection militia service.</statement>
    </claim>
    <claim id="i1n2" author="sb" textat="07-290.sb#getthis">
        <statement>no</statement>
    </claim>
</issue><!--i1-->

     <snip>

 

harvey



More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

Error compiling for board Arduino/Genuino Uno.

Installation database is corrupt

esp8266 (nodemcu 0.9) client.write très lent ???