title: Resizing a container when child's visibility is changed?
body: <p>When I set the visible property to false for a child in a container, how can I get the container to resize? In the example bellow, when clicking on "Toggle", "containerB" is hidden, but the main container's scrollable area is not resized. (I do not want to scroll through a lot of empty space.)</p>
  
  <pre><code>&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"&gt;
  &lt;mx:Script&gt;
      &lt;![CDATA[
          public function toggle():void {
              containerB.visible = !containerB.visible;
          }
      ]]&gt;
  &lt;/mx:Script&gt;
  &lt;mx:VBox height="300" width="200" horizontalAlign="center"&gt;
      &lt;mx:Button label="Toggle" click="toggle()" width="200"/&gt;
      &lt;mx:VBox id="containerA" height="400" width="150" horizontalAlign="center"&gt;
          &lt;mx:Button label="A" height="400" width="100"/&gt;
      &lt;/mx:VBox&gt;
      &lt;mx:VBox id="containerB" height="400" width="150" horizontalAlign="center"&gt;
          &lt;mx:Button label="B" height="400" width="100"/&gt;         
      &lt;/mx:VBox&gt;
  &lt;/mx:VBox&gt;
  </code></pre>
  
  <p></p>