# Border not disappearing

**URL:** <https://forum.kirupa.com/t/border-not-disappearing/307797>\
**Category:** Uncategorized\
**Created:** [April 10, 2010, 4:05pm UTC](https://forum.kirupa.com/t/border-not-disappearing/307797 "2010-04-10T16:05:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mgarsteck](https://avatars.discourse-cdn.com/v4/letter/m/bcef8e/32.png) [@mgarsteck](https://forum.kirupa.com/u/mgarsteck)\
**Post date:** [April 10, 2010, 4:05pm UTC](https://forum.kirupa.com/t/border-not-disappearing/307797/1 "2010-04-10T16:05:50Z")

</div>

Im unable to figure out why the border I create is not removing its self after I removeChild.

Here is my code:

```auto
function gallerySet(event:MouseEvent):void {

	picLoad.load(new URLRequest(myXML.Gallery[galNum].Image[event.target.name].@picURL));
	picWidth = myXML.Gallery[galNum].Image[event.target.name].@Width;
	picHeight = myXML.Gallery[galNum].Image[event.target.name].@Height;

	addChild(holder);
	holder.addChild(picLoad);
	holder.addChild(bordCon);
	
	TweenLite.to(holder, .5, {alpha:1});
	//TweenLite.to(border1, .5, {alpha:1});
	picLoad.x = ((holder.width - picWidth) / 2) + 75;
	picLoad.y = (holder.height - picHeight) / 2;
	
	var border1:Shape = new Shape();
	border1.graphics.lineStyle(1, 0xffffff);
	border1.graphics.drawRect(picLoad.x, picLoad.y, picWidth, picHeight);
	bordCon.addChild(border1);
	
	

	picLoad.alpha = 0;

	TweenLite.to(picLoad, 2, {alpha: 1});

	
	holder.exitBtn.addEventListener(MouseEvent.CLICK, exit2);
	holder.addEventListener(MouseEvent.MOUSE_DOWN, dragOn2);
	holder.addEventListener(MouseEvent.MOUSE_UP, dragOff2);

}

//this is where I exit the holder...
function exit2(event:MouseEvent):void {

	TweenLite.to(holder, .5, {alpha:0});
	TweenMax.to(bkg, .5, {alpha:1});

	holder.addEventListener(Event.ENTER_FRAME, exit2b);
}

function exit2b(event:Event):void {

	if (holder.alpha == 0 ) {
		
		bordCon.removeChildAt(0);
		removeChild(holder);
		holder.removeEventListener(Event.ENTER_FRAME, exit2b);

	}
}

```

the holder and border goes away, however when I go to another gallery the previous borders pop up. Instead of creating a new border and deleting the old one it is creating a new border and the old one still remains.
