Recently I was working on a Flex project and realize upon having my project on the live server , I couldn’t retrieve the height and width property of my loaded image by doing below
var img:Image = new Image(); img.source = "image.jpg" trace(img.height); trace(img.width);
The trace statement above will just show 0 for both width and height. Of course after a few hours of searching Google for a solution I realized on the livedocs documentation for Image has the property contentWidth and contentHeight which provides the height and width of the image loaded.
var img:Image = new Image(); img.source = "image.jpg" trace(img.contentHeight); trace(img.contentWidth);