Using the same actionscript twice?

Hi,

Ok I think this should be possible but for the life of me I cannot get it to work. I want to use the same actionscript twice on the same movieclip. Let me explain - I have a sequence of images that I want to show, instead of just fading them in I want to use a mask that will grow in size to reveal them - the mask is an odd shape and gives me the effect I want.

This is the actionscript I am currently using on the first frame on the timeline in a layer called “Actions”:

[AS]
//Main timeline
function enlarge(endW, endH, speed){
onEnterFrame = function(){
mc_rand2._width += (endW - mc_rand2._width) / speed;
mc_rand2._height += (endH - mc_rand2._height) / speed;

             if(mc_rand2._width == endW && mc_rand2._height == endH){
                     delete onEnterFrame;
             }
     }

}
[/AS]

So, in my scene I also have movieclip called “mc_rand2”. I have put the following code in this movieclip:

[AS]
onClipEvent (enterFrame) {
_root.enlarge(1000, 700, 4);
}
[/AS]

Now, this works fine for the first movieclip that is in the timeline, but if there are two of the “mc_rand2” movieclips on the timeline, then the second does not work - only the first.

Any ideas?

Cheers,
Chris