How can I get the width of an externally loaded picture?
I have this:
pic_mc.loadMovie("images/pic.jpg");
pic_mc.onEnterFrame = function() {
if (this._width) {
trace(this._width);
}
}
but it is not working. I’ve also tried calling this.getBytesLoaded/Total within the onEnterFrame and as pic_mc.getBytesLoaded alone, but it returns 4 and my picture is 40k. I’ve also tried pic_mc.onLoad, but it never advances.
I think it is trying to get the width before it loads, but how do I prevent that?
Thanks,
-Joshua