0 Replies Latest reply on Oct 27, 2009 7:54 PM by wilrevehl007

    Get new Image width after img.maxHeight

    wilrevehl007

      I'm trying to get the new width of an image after applying the maxHeight property but I can't seem to catch anything from it.  I am doing this in a custom component that is loading the images at runtime.  I figured an event listener would work to know when the image was loaded or know when Flex resized it but no matter the Event or FlexEvent I try I can't seem to get the new width based on apsect ratio from maxHeight being applied.  Anyone have any ideas?  Thanks for any insight on this friends.

       

      i = new Image();
      i.source = thURL;
      i.maxHeight=thumbH;

       

      i.addEventListener(Event.ADDED_TO_STAGE, testDims);

       

      private function testDims(evt:Eventt):void
              {
                  var img:Image = evt.currentTarget as Image;
                  trace(img.width);
              }