# How to work with removeChild() .. HELP

**URL:** <https://forum.kirupa.com/t/how-to-work-with-removechild-help/329588>\
**Category:** Uncategorized\
**Created:** [September 19, 2012, 3:13am UTC](https://forum.kirupa.com/t/how-to-work-with-removechild-help/329588 "2012-09-19T03:13:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nahaks](https://avatars.discourse-cdn.com/v4/letter/n/5f8ce5/32.png) [@nahaks](https://forum.kirupa.com/u/nahaks)\
**Post date:** [September 19, 2012, 3:13am UTC](https://forum.kirupa.com/t/how-to-work-with-removechild-help/329588/1 "2012-09-19T03:13:51Z")

</div>

Firstly,

how do I set the buttons to only be selected ONCE , if another button is clicked … it will give no response.

Secondly,

what do i do to clear the image from the UrlRequest from the selected buttons (image will be displayed) with removeChild

As you can see below, all the buttons can be selected … all at once. which is wrong.  
and also, the removeChild will only work without error #2025 if two buttons (and two images) were shown. which is also wrong.

```auto

stop();

aa1.addEventListener(MouseEvent.CLICK, ona1Click);
bb1.addEventListener(MouseEvent.CLICK, onb1Click);
cc1.addEventListener(MouseEvent.CLICK, onc1Click);
next1.addEventListener(MouseEvent.CLICK, onNext1Click);
home1.addEventListener(MouseEvent.CLICK, onHome1Click);

var Q1a:Loader = new Loader();
var Q1b:Loader = new Loader();
var Q1c:Loader = new Loader();
var Q1next:Loader = new Loader();
var Q1home:Loader = new Loader();

//the name of the function has to match what you're calling from the event listener
function ona1Click(evt:MouseEvent):void {

var myQ1a:URLRequest=new URLRequest("wrong.png");
Q1a.load(myQ1a); 
addChild(Q1a);

Q1a.x=320; 
Q1a.y=180;
}

function onb1Click(evt:MouseEvent):void {

var myQ1b:URLRequest=new URLRequest("tick.png");
Q1b.load(myQ1b); 
addChild(Q1b); 

Q1b.x=320; 
Q1b.y=260;
}

function onc1Click(evt:MouseEvent):void {

var myQ1c:URLRequest=new URLRequest("wrong.png");
Q1c.load(myQ1c); 
addChild(Q1c); 

Q1c.x=320; 
Q1c.y=340;

}

function onNext1Click(evt:MouseEvent):void {

removeChild(Q1b);
removeChild(Q1a);

gotoAndPlay(2);

}

function onHome1Click(evt:MouseEvent):void {
gotoAndPlay(17);
}

```

HELP me.
