The final function is used to remove the movieclips once you progress to the next frame. It is call by the next button within the program: (_root.code.clearscreen();)
function clearscreen() {
for (i = 0; i <_root.howmany; i ++) {
_root["t" + i].unloadMovie();
_root["o" + i].unloadMovie();
}
}