Try this:
trace("iw "+bImage.contentWidth);
trace("ih "+bImage.contentHeight);


LD

--- In [email protected], 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
>


Reply via email to