Stopping or starting a movie clip at a random frame

hi,
i am loading random movie clips into 4 seperate empty movies, i now need a way to get these random clips that i am loading to play for a random amount of time and then load the next clip.

if i assign it a random number and get the clip to loop, then compare the number to the current frame of the movieclip and if true, tell it to stop and move to the next random clip…would this work?

i have no idea how to write the code for this
any help would be great

thanks

[COLOR=black][COLOR=#000000]After loading, do [AS]var rnd = Math.round(Math.random(mc._totalframes));
mc.onEnterFrame = function() {
this._currentframe >= this._parent.rnd ? unloadMovie(this) : null;
}[/AS]
[/COLOR][/COLOR]

where do i put this?
the timeline, emptymovieclip holders, or in each individual clip loaded?