Mass items, same code

I have a game where the character picks up coins, the coins adds to there score. I can use the following code and place it on each of the coins.

[AS]onClipEvent(enterFrame){
if(this.hitTest(_root.guy)){
_root.score += 1;
unloadMovie(this);
}
}[/AS]

However, I want many coins on the stage and this will slow it down alot.

I am looking for something that can be writen on the main time line and then applied to all of the coins on the stage.

This could also be useful for multiple enemies which have A.I for moving and attacking.

Any help would be great