title: Flex4, centering and resizing a image inside a group container
body: <p>I'm looking for the best way to get a flex 4 image object to resize and horizontally center whenever its parent container (a custom component based on group) resizes.  I cannot set horizontalCenter="0" to accomplish the image centering because I use a move transition to "slide" the image in and out of view.</p>
  
  <p>I'm externally setting the image source in the component.  Here is a simplified example of my component code that only addresses  resizing the image.</p>
  
  <pre><code>&lt;s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" 
           xmlns:s="library://ns.adobe.com/flex/spark" 
           xmlns:mx="library://ns.adobe.com/flex/halo" &gt;
  
      &lt;fx:Script&gt;
          &lt;![CDATA[                   
              public function assignImage(imgUrl:String):void
              {
                  imgA.source = imgUrl;
                  imgA.visible = true;
              }
  
              override protected function updateDisplayList(w:Number,h:Number):void
              {
                  imgA.width = w;
                  imgA.height = h;
                  super.updateDisplayList(w,h);           
              }        
          ]]&gt;
  
      &lt;/fx:Script&gt;         
  
      &lt;s:Image id="imgA" visible="false" top="0" maintainAspectRatio="true"  /&gt;        
  &lt;/s:Group&gt;
  </code></pre>
  
  <p>Any help is greatly appreciated -- I'm also open to an alternate method of resizing the image if it makes more sense.</p>
  
  <p>Thanks in advance</p>