Формирую фотогалерею вот так

Код:
Gallery = function (f){
var a=f.split(",");
portfolioInfo = new XML();
portfolioInfo.ignoreWhite = true;
timeline = this;
tileWidth = 65;
tileHeight = 65;
portfolioInfo.onLoad = function(){
portfolioTag = this.firstChild;
count = portfolioTag.childNodes.length;
for (child = 0; child < count; child++){
currentPicture = portfolioTag.childNodes[child];
currentThumb = img.createEmptyMovieClip("thumbnail"+child,child);
currentThumb._x = -321 +((child%5)+5*(x>=5))*tileWidth;
currentThumb._y = 35+(Math.floor((child%20)/5))*tileHeight;
image = currentThumb.createEmptyMovieClip("thumbnail_image",0);
currentThumb.IMAGE = currentPicture.attributes.IMAGE;
currentThumb.HEIGHT = currentPicture.attributes.HEIGHT;
currentThumb.WIDTH = currentPicture.attributes.WIDTH;
image.loadMovie(currentPicture.attributes.THUMB);
currentThumb.onRelease= function(){
getURL("javascript: void window.open('"+this.IMAGE+"','Gallery','scrollbars=0,status=0,resizable=0,width="+this.WIDTH+",height="+this.HEIGHT+",top='+(screen.height/2-"+this.HEIGHT+"/2)+',left='+(screen.width/2-"+this.WIDTH+"/2)+',location=0,menu=0')");
}
}
}
portfolioInfo.load("http://www.lunaticscale.ru/Faces/"+a[2]+"/data"+a[1]+".xml");}
Там формируются превьюшки.
Как мне сделать очистку формирующегося мувика при нажатии на какую нибудь кнопку. Пробовал _root.img.removeMovieClip(); не прокатило.
Не забываем пользоваться тегами форматирования кода