14 Replies Latest reply on Jul 22, 2010 10:29 AM by Peter deHaan

    Why is a Spark TextArea tiny, when a Height and Width are set? [FLEX 4]

    CharlesBroughton_112

      Here is my problem, fairly obvious: [img at bottom]

      The problem, as you can see, is that the text (height and width) is  nothing like the Height and Width of the compoent (Spark TextArea) that I  have set via the Main.mxml file in Flex 4.  This is pissing me off so  much because nobody can tell me why this is happening, or how to fix it.   Text is dynamically added to the TextArea as people send messages in  the server, hence the valueCommit line.

      I don't understand this, because I know it's not the fault of my  fx:Script.  I know this, because when I switch over to the Design tab of  Adobe Flex Builder 4; the lines are just as messed up as in the screen  shot.

      I've been tearing my hair out (metaphorically) over this issue,  please help me come to an answer:

       

      <s:TextArea id="incomingMessages" includeIn="interface"
        heightInLines="{NaN}" widthInChars="{NaN}"
        y="10" x="9" minWidth="426" minHeight="442"
        text="Connected to Chat Paradise v5.00a, By CharlesBroughton."
        valueCommit="incomingMessages_valueCommitHandler(event)"/>
      
      

       

      Here is the FX:SCRIPT for incomingMessages_valueCommitHandler(event)  if you care:

       

      protected function incomingMessages_valueCommitHandler(event:FlexEvent):void
      {
        if (scrollToggle.selected)
         incomingMessages.textDisplay.verticalScrollPosition = incomingMessages.textDisplay.maxHeight;
      }
      
      

       

      I'm not allowed to post images [less than 10 repute] so here is a  link: Image Link

       

      Message was edited by: CharlesBroughton_112;  I had to make changes to make syntax highlighting work.