Adding OnEnterFrame to a Loop

I am placing via actionscript an entire grid of squares to fill the screen.
They are placed on stage through a For loop.
I would like each movieClip added to obtain a function (as you would use onClipEvent() if the movie Clip was already on the stage) …

But as these clips are being dynamically added - how or where would I add the function in the code?

sw = Stage.width/2;
sh = Stage.height/2;
h = 22; 
t = 10; 
for(i=0; i< t; i++){
   var xPos:Number = i*22;
   _root.attachMovie("wave","_mc"+*,this.getNextHighestDepth(),{_x:sw+xPos,_y:sh}) };

So I would like EACH attached _mc to have an OnEnterFrame Event occurance … Where could I add the intended function … ie: this._x = _root._xmouse;

Thanks!!!