Dynamic movieclip.onPress event handler problem

I’m loading a couple of instances of a movieclip from the library (they are set to ‘export for actionscript’) and it works flawless… but one thing fails. I want to add an action to these clips, that when someone clicks them an action is performed. So I tried to use the onPress event handler. This doesn’t work. When I try the OnMouseDown handler it works… but it works when you click anywhere, that’s not what I want…

Here is the code (it is situated in a loop, the i variable is an incremental counter):

_root.createEmptyMovieClip("overlay"+i, _root.getNextHighestDepth());
_root.attachMovie("overlayKnop", "overlay"+i, _root.getNextHighestDepth(), {_x:sw + (i * 155), _y:sh + 222});
_root["overlay"+i].onPress = function() {

Any solutions? Thanks in advance…