# Image.\_width/.\_height returning 0

**URL:** <https://forum.kirupa.com/t/image--width--height-returning-0/235107>\
**Category:** Uncategorized\
**Created:** [August 8, 2007, 3:13pm UTC](https://forum.kirupa.com/t/image--width--height-returning-0/235107 "2007-08-08T15:13:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bardic](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/bardic/32/3708_2.png) [@bardic](https://forum.kirupa.com/u/bardic)\
**Post date:** [August 8, 2007, 3:13pm UTC](https://forum.kirupa.com/t/image--width--height-returning-0/235107/1 "2007-08-08T15:13:55Z")

</div>

I am having a problem with images. I am loading them from XML. No prob. They load, they display. The problem is when I try to get their height or width, it just returns 0.

I’ve tried using an onEnterFrame that checks if all the bytes are loaded, but it never fires. I must be doing something wrong but I can’ figure it out.

here what I have so far for my code:

```auto

function createContent(){
    this.createEmptyMovieClip("mainContent",this.getNextHighestDepth());
        mainContent.createEmptyMovieClip("imgHolder",mainContent.getNextHighestDepth());
        mainContent.createTextField("mainTxt",mainContent.getNextHighestDepth(),0,0,300,400);
            mainContent.imgHolder.loadMovie(contentXML.firstChild.childNodes[0].attributes.i);
            mainContent.mainTxt.text = contentXML.firstChild.childNodes[0].attributes.t;
        mainContent.imgHolder._x = 100;
        mainContent.imgHolder._y = 15
        mainContent.mainTxt._x = mainContent.imgHolder._x + mainContent.imgHolder._width + 50;
        mainContent.mainTxt._y = 15;
        mainContent.mainTxt.wordWrap = true;
        trace(mainContent.imgHolder._height);
}

```

As you can see I’m simply creating some clips and filling one with a pic and the other with some text both take from XML. The xml is working because it loads the text and image. It’s just when I try to get the height or width of the loaded image that I encounter a problem.

Any help would be very useful since I have this problem across a few files I am working on at the moment.
