Newbie: How stop MC inside main timeline?


I’m not really that much of a newbie, except in AS. I’m sure I’m just looking at this problem wrongly, but I’m running out of time to hunt down the answer or use trial and error.

I have a movie into which I’ve put a small mc of an “electron” on its own level, in the main timeline. There are several other layers with animation on the main timeline too.

The electron MC is set to duplicate 50X.

Below is the AS on the main timeline, in the electron layer:

for (var i = 0; i<50; i++) {
particle1.duplicateMovieClip(1, i);

Inside the electon MC itself is AS to make all the duplicated electrons fly about “randomly”.

Below is the AS attached to the single electron incidence visible in the main timeline:

onClipEvent (load) {
//movie width/height
height = 400;
width = 550;
//makes everything random //
this._x = Math.round(Math.random()*width);
this._y = Math.round(Math.random()*height);
var temp = this._alpha=Math.random()*100;
this._xscale = this._yscale=temp;
//setting initiaion position
cx = this._x;
cy = this._y;
onClipEvent (enterFrame) {
//causes the object to be offset
this._x = cx+(1+Math.random()*100);
this._y = cy+(1+Math.random()*100);


Everything works fine except:

When the main timeline movie ends the MC of the flying electrons continues indefinitely.

I’m looking for a simple stop for the duplicated, flying electrons about half way into the main movie.