Creating MC's dynamically

[FONT=Arial]Hi![/FONT]

[FONT=Arial]I need some serious help here. I’m trying to create x movieclips on the fly and loading each with a unique image. Each dynamically created movieclip shall have it’s on onRelease function that shall be invoked when pressed. I’m doing the following: [/FONT]

 
for(var i:Number = 0; i<2; i++){
var objectName:String = "stillLife_" +i;
_root.createEmptyMovieClip(objectName, _root.getNextHighestDepth());
_root[objectName].loadMovie(objectContainer*.getThumbImagePath());
_root[objectName]._x = (i * 150) + 200;
_root[objectName].onRelease = function():Void {
}
}

[FONT=Arial]It all works except for the onRelease part. Please help me! I’m stuck!!![/FONT]