Dynamically created mc + addressing / event

Hi guys,

does anyone have a tip on how to “bind” events to dynamically created movieclips ?


public function createClip():Void {
 
var _images:ImageElement;
var x:Number = 0;
var y:Number = 0;
var _cc:Number = 0;
for (var j:Number = 0; j < _objectArray.length; j++) {
	_images = _objectArray[j];
 
	if (_images.get_image_page() == _cpage) {
	 rootMC.createEmptyMovieClip("images_"+_cc,_cc);
 
 
	 loadMovie(thumb_path + "/" + _images.get_image_thumb(),["images_"+_cc]);
	 setProperty("images_"+_cc,_x,x);
	 setProperty("images_"+_cc,_y,y);
 
 
	 ["images_"+_cc].onPress = function() {
	 trace("CLICKED!");
	 }
 
	 _cc++;
	}
}
}

["images_"+_cc].onPress = function() {
trace ("Blah");
}

gives me the following error :


Unexpected '.' encountered
		 ["images_"+_cc].onPress = function() {

does anyone know how to bind (correct addressing syntax) the onPress function to the dynamically created movieclips ? :h:

thx,

bustaa