Does anyone know why the mx:Image fires the complete event before the
image has been completely loaded?
I have the following code
private function photoComplete(event:Event):void
{
trace (photo_img.width + ' ' + photo_img.height);
}
<mx:Image id="photo_img" complete="photoComplete(event)"/>
When the photoComplete gets called the width and height are traced out
as '0'. What I had to do was add a little logic snippet to say if the
width and height are '0' do a callLater, and call back to the
photoComplete again, sometimes it takes 2 or 3 callbacks for the size
to register.
Any idea why? I would think that when the 'complete' gets fired the
mx:Image should know the size of the picture it has loaded.
Derrick