title: Flex: How to control spacing between form item and corresponding errorString?
body: <p>Here's a simple application to illustrate my question. Instructions:</p>
  
  <ol>
  <li>run the attached Flex 4 code</li>
  <li>enter 0 in the first form item (e.g. "Enter Speed (MPH)")</li>
  <li>click on the second form item</li>
  <li>observe that the error string occurs way to the right of the first form item</li>
  </ol>
  
  <p>Question: How to make the error string appear directly to the right of the first form item, while keeping the width of the form fixed (e.g. the current example uses a fixed form width of 400 px)?</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                 xmlns:s="library://ns.adobe.com/flex/spark" 
                 xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"&gt;
  
      &lt;fx:Script&gt;
          &lt;![CDATA[
              private function validateSpeed():void {
                  var num:Number=Number(speedId.text);
                  speedId.errorString="";
  
                  if (speedId.text=="") {
                      speedId.errorString="This field is required.";  
                      return;
                  } else if ( Number(speedId.text)&lt;1000) {
                      speedId.errorString="The speed must be at least 1 MPH.";
                      return;
                  } else if ( Number(speedId.text)&gt;1e11) {
                      speedId.errorString="The speed cannot exceed 100 MPH.";
                      return;
                  }
              }       
          ]]&gt;
      &lt;/fx:Script&gt;
  
      &lt;s:Form width="600" &gt;   
          &lt;s:layout&gt;
              &lt;s:FormLayout gap="-10" horizontalAlign="center"/&gt;
          &lt;/s:layout&gt; 
  
          &lt;s:FormItem id="speedFI" label="Enter Speed (MPH):" width="600" required="true"&gt;
              &lt;s:TextInput id="speedId" width="195" textAlign="right"
                       restrict="0-9" maxChars="7"
                       focusOut="validateSpeed();"
                       toolTip="Enter a speed between 1 and 100 MPH."/&gt;
          &lt;/s:FormItem&gt;   
  
          &lt;s:FormItem id="dummyFI" label="Dummy Label:" width="600" required="true"&gt;
              &lt;s:TextInput id="dummyId" width="195" textAlign="center"
                       restrict="0-9" maxChars="7" prompt="Click here after entering 0 above."
                       toolTip="Dummy form item."/&gt;
          &lt;/s:FormItem&gt;           
      &lt;/s:Form&gt;
  &lt;/s:Application&gt;
  </code></pre>