Even the experts ares tumped :-)

I’ve asked this question before and no-one seems to be able to answer it. I am altering the familiar image carousel script but seem unable to determine the “actual” height of an image loaded into an mc - after it has been loaded - Actionscript always returns the height of the replaced mc instead.


var numOfItems:Number; var initialX:Number = 0; var home:MovieClip = this;

var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function(){
    var nodes = this.firstChild.childNodes;
    numOfItems = (nodes.length - 1);
    if(numOfItems == 0){ gotoAndStop(2); } // if the xml file is empty
    for (var i = 0; i<numOfItems; i++) {
        var t = home.attachMovie("item", "item"+i, i+1);
        t.inner.loadMovie(nodes*.attributes.image);
        t.imgsrc = nodes*.attributes.image;
        t._x = initialX; t._y = 0; initialX += 92;
    }
}

If I do a debug, the loaded xml (a list of image names) is loaded correctly and the movie clip item is reproduced on the stage. It’s internal mc (inner) is also replaced by the actual image. But the image is aligned to the top left (and since they all have different heights it looks kinda silly). In the debugger _level0.item0.inner._height is 62 pixels tall (which is correct) but if i do a trace in the movie asking exactly that question it always return 92 (which is the height of the mc inner not the actual image loaded into the mc).
Once I can reference it I can change it hopefully.
any ideas anyone? - all help greatly appreciated :slight_smile: