Great that works,
any suggestions on how to get the scalled size of the image if I place
it in the top frame of a VDividedBox, and set the image w and h to 100%
So the image will scale to fit into the pane when the dividerBar is dragged.
lar.drolet wrote:
Try this:
trace("iw "+bImage.contentWidth);
trace("ih "+bImage.contentHeight);
LD
--- In [email protected]
<mailto:flexcoders%40yahoogroups.com>, Russell Sprague <[EMAIL PROTECTED]>
wrote:
>
> It seems that if an image is loaded into an Image tag at runtime, the
> size is w=0 h=0, ex.
>
> private var imgsrc:String;
> public function loadImage(val:String):void{
> imgsrc = "assets/images/"+val;
> }
> private function imgLoaded(e:Event):void{
> trace("tw "+this.width);
> trace("iw "+bImage.width);
> trace(e.target.width);
> }
> ...
> <mx:Image id="bImage" source="{imgsrc}" complete="imgLoaded(event)"
> horizontalCenter="0" verticalCenter="0"/>
>
> if I call the loadImage function with a image url string,
> even after the image loads into the Image tag, it returns 0 for the
> width and height of the Image tag.
>
> I tried using a callLater function in the loadImage function, but it
> gave the same results.
>
> Is there a way to get the width and height of an Image tag if it loads
> in an image at runtime?
>
> Thanks
> Russ
>