# addChild Problem

**URL:** <https://forum.kirupa.com/t/addchild-problem/298084>\
**Category:** flash\
**Created:** [October 13, 2009, 2:37pm UTC](https://forum.kirupa.com/t/addchild-problem/298084 "2009-10-13T14:37:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ruiganga](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ruiganga/32/3679_2.png) [@ruiganga](https://forum.kirupa.com/u/ruiganga)\
**Post date:** [October 13, 2009, 2:37pm UTC](https://forum.kirupa.com/t/addchild-problem/298084/1 "2009-10-13T14:37:22Z")

</div>

HI

I have a MC that I add to the stage multiple times using addChild. My adding code is:

```auto
function executeAddChild():void {

	for (var j:int = 0; j < picturesList.length; j++) {
		var MC:MovieClip = new box();
		scrolly.contenty.addChild(MC);
		MC.name="mc"+j;
		MC.instanceName="mc"+j;
		trace(MC.instanceName+" INSTANCEname");
		MC.y=MC.height*j+MC.y;
		MC.imageName.text=picturesList[j].substr(picturesList[j].indexOf("jpg")-9,12);
		MC.quantity.text=quantityList[j];
		MC.invisibleNumber.text = j+1;

	}

}

executeAddChild();

```

until here I am happy.

The problem is that inside the each MC I have a number, inside a textBox (quantity.text). I need to access that number but I don’t know how! I want to update an array with the new quantity values inside each MC and then REMOVE the ZERO VALUES… and so on… I don’t know how to explain my app. All I need to know is how to access the value inside the MC added using addChild.

I’ve tryed like this:

```auto
function clearAddChild(e:Event):void {
	trace("numChildren"+scrolly.contenty.numChildren);
	trace("UPDATE AND REMOVE");
	for (var i:int = 0; i < scrolly.contenty.numChildren+i; i++) {
		trace("START ---------- i: "+i);
		trace("quantity: "+scrolly.contenty.getChildAt*.quantity.text); //here is the error
		scrolly.contenty.removeChildAt(0);
		trace("END ------------ i: "+i);
	}
	executeAddChild();
}

actualizar.addEventListener(MouseEvent.CLICK, clearAddChild);

```

It is giving me the following error:

ReferenceError: Error #1069: Property 2 not found on builtin.as$0.MethodClosure and there is no default value.  
at efwf\_fla::MainTimeline/clearAddChild()

what should I do?

Thanks
