Attach movieclip ... how to clear it out?

i’m making my own combo box based on an array that can change based on a user input variable. i need to find a way to update the dynamically attached mc’s based on when that array changes. that or to use a button (as i’m currently using to trigger it) to clear out the clips i’m attaching and attach a new number of clips for the updated(new) array.

here’s what i have:

stop();
var columnsb=1;
var list_spacingb = 20;

var years_array= ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13"];

loanButton.onRollOver=function(){
	
	if (PurchasePrice != undefined){
//tried to use removeMovieClip without success!
		attachClip.removeMovieClip("termClip"+i);
		
		
		if(PurchasePrice > 0 && PurchasePrice <= 10000){
			displayArray = years_array.slice(0,6);
		}
		if(PurchasePrice >=10000 && PurchasePrice <= 15000){
			displayArray = years_array.slice(0,10);
		}
		if(PurchasePrice >=15000 && PurchasePrice <=25000){
			displayArray = years_array.slice(0,12);
		}
		trace(displayArray);
		buildMenu(displayArray);
		}
}

buildMenu=function(displayArray){
	trace(displayArray);
	arrayLength=displayArray.length;
	for(i=0; i<arrayLength; i++){
		item=attachClip.attachMovie("termClip", "termClip"+i, i);
		item.index=i;
		item._x = (i%columnsb)*list_spacingb;
      	item._y = Math.floor(i/columnsb)*list_spacingb;
		item.termYears=displayArray*+" years";
	}
		item.termButton.onRelease=function(){
		var id = this._parent.index;
		varsHolder.term=displayArray(id);
		loanTerm=displayArray(id);
	}
	displayArray="";
		
	
	
}

i should clarify that it’s working, but i need the attached clips to reset each time the function occurs because sometimes there’ll be less clips attached if the array length is less and right now if the array length is twelve and then it gets changed to 6, there are still 12 clips attached! (make sense?)