# Determining dimensions of external images

**URL:** <https://forum.kirupa.com/t/determining-dimensions-of-external-images/116129>\
**Category:** Uncategorized\
**Created:** [July 14, 2004, 8:56pm UTC](https://forum.kirupa.com/t/determining-dimensions-of-external-images/116129 "2004-07-14T20:56:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mucus\_snot](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@mucus\_snot](https://forum.kirupa.com/u/mucus_snot)\
**Post date:** [July 14, 2004, 8:56pm UTC](https://forum.kirupa.com/t/determining-dimensions-of-external-images/116129/1 "2004-07-14T20:56:56Z")

</div>

Hi,  
I am trying to determine the dimensions (\_height,\_width) of an external image in order to position the movie that I am loading the image in. The following code loads the image OK, but the \_width is always 0? (the first bit of the code is just a fix I found for the onload event, which wasn’t getting fired). Can anyone help???  
thanks

[color=red]sol = function (f){  
if( **onLoadHandler** == undefined) \_global. **onLoadHandler** = {};  
**onLoadHandler** [this] = f;  
};  
//getter for onLoad  
gol = function(){  
return **onLoadHandler** [this];  
}  
//assign property-handlers for onLoad (courtesy of Gnut)  
MovieClip.prototype.addProperty(“onLoad”, gol, sol);[/color]  
[color=red][/color]  
[color=#ff0000]//////////////////////////////////////////////////////////////[/color]  
[color=#ff0000][/color]  
[color=red]createEmptyMovieClip(“myImage”, 4);  
myImage.onLoad = function() {  
trace(this.\_width); // why 0?  
};  
loadMovie(“external\_image.jpg”, “myImage”);[/color]
