# Removing multiple clips

**URL:** <https://forum.kirupa.com/t/removing-multiple-clips/196268>\
**Category:** flash\
**Created:** [August 7, 2006, 8:25am UTC](https://forum.kirupa.com/t/removing-multiple-clips/196268 "2006-08-07T08:25:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fried](https://avatars.discourse-cdn.com/v4/letter/f/3d9bf3/32.png) [@fried](https://forum.kirupa.com/u/fried)\
**Post date:** [August 7, 2006, 8:25am UTC](https://forum.kirupa.com/t/removing-multiple-clips/196268/1 "2006-08-07T08:25:50Z")

</div>

I am attaching movie clips to the stage according to how many items are in an XML list. Everything works fine, but when I click on the next button I want the attached clips to be removed. when using itemAdd.removeMovieClip(), it only removes the last one.

I have modified the code to:

```auto
var item_spacing = 40;
var item_count = 0;

function loadInfo(info_xml){

	var info = info_xml.firstChild.childNodes;

		for (var i=0; i<7; i++){
		var itemAdd = attachMovie("holder_clip","holder_clip"+i, item_count);
		itemAdd._y = 0;
		itemAdd._x =(110)+(92*(i));
		item_count++;
		
		var TxtAdd = attachMovie("text_holders","text_holders"+i, item_count);
		TxtAdd._y = 58;
		TxtAdd._x = (125)+ (92*(i));
		item_count++;
		
		
		itemAdd.jpg_holder.loadMovie(info_xml.firstChild.childNodes*.childNodes,1);
		TxtAdd.playedTxt = info_xml.firstChild.childNodes*.attributes.played;
		TxtAdd.pointsTxt = info_xml.firstChild.childNodes*.attributes.points;
	
		next_but.onRelease = function(){
			for(var i=0; i<7;i++){
					this["holder_clip"+i].removeMovieClip();
				}
			for (var z=7; z<14; z++){
				var itemAdd2 = attachMovie("holder_clip","holder_clip"+z,item_count);
				itemAdd2._y = 0;
				itemAdd2._x =(-540)+(92*(z));
				item_count++;
				
				itemAdd2.jpg_holder.loadMovie(info_xml.firstChild.childNodes[z].childNodes,1);
				
			}
		}
     }
}
var my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(success){
	if(success) loadInfo(this);
	else trace("Error Loading")
}
my_xml.load("teams.xml");

stop();

```

using

```auto
for(var i=0; i<7;i++){
		this["holder_clip"+i].removeMovieClip();
	}

```

but it does not work. Any help would be greatly appreciated.
