onClipEvent to attached movieClip

I have short script (onClipEvent (enterFrame) {some code here}) that works well on movieClip that is on Stage. I’ve added the script to ‘actions - movie clip’ -window).
But my problem is that movieclip should be attached dynamically usign actionscript, so I cannot add the script to the clip, as I used to.
Can anyone please point me in the right direction !