# Determining dimensions of external images

**URL:** https://forum.kirupa.com/t/determining-dimensions-of-external-images/57632
**Category:** flash
**Created:** [July 14, 2004, 8:56pm UTC](https://forum.kirupa.com/t/determining-dimensions-of-external-images/57632 "2004-07-14T20:56:56Z")
**Posts on this page:** 2
**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/57632/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]

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 15, 2004, 2:09am UTC](https://forum.kirupa.com/t/determining-dimensions-of-external-images/57632/2 "2004-07-15T02:09:23Z")

</div>

dont use \_width or \_height, use

```auto
trace(this._xscale);
trace(this._yscale);

```
