You should listen for the INIT event, not the COMPLETE one - the images
won't have a width until they are initialised.
Glen
On 01/07/2010 13:50, Pankaj Singh wrote:
hello everyone
i am trying to set x positions of different images which are being
dynamically loaded depending upon their width
i m writting this code in a for loop
imageLoader[i].load (new URLRequest(
xmlLettersList[i].attribute("img")));
imageLoader[i].width = imageLoader[i].addEventListener
(Event.COMPLETE, imgLoaded);
trace("width = " + imageLoader[i].width);
function imgLoaded (e:Event):Number
{
var bm:Bitmap = Bitmap(e.target.content);
trace("inside function image Loaded");
return bm.width;
}
but width comes out to be zero ..
help is needed
waiting for your response
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders