Image._width/._height returning 0

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:


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.