Setting functions in a loop

Hey people

I’m trying to set some rollover functions to duplicated mc’s inside a loop. There is probably some logic as to why it doesn’t work, I just don’t see it. The rollover function only gets applied to the last image/mc duplicated. Some help would be nice, thanks.

[AS]
xml.onLoad = function() {
nodes = this.firstChild.childNodes;
for(i=0; i<nodes.length; i++){
temp_inst = testthingy.duplicateMovieClip(“thumb”+i, i);
temp_inst._x = xPos;
temp_inst._y = 0;
var mcListener:Object = new Object();
mcListener.onLoadInit = function(){
temp_inst.onRollOver = function(){
trace(“weeee”);
}
}
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(mcListener);
mcLoader.loadClip(nodes*.attributes.url, temp_inst);

	xPos += parseInt(nodes*.attributes.width);
}

}
[/AS]