# Delete TextField instances

**URL:** <https://forum.kirupa.com/t/delete-textfield-instances/227553>\
**Category:** Uncategorized\
**Created:** [May 31, 2007, 7:56am UTC](https://forum.kirupa.com/t/delete-textfield-instances/227553 "2007-05-31T07:56:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bzouchir](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/bzouchir/32/2088_2.png) [@bzouchir](https://forum.kirupa.com/u/bzouchir)\
**Post date:** [May 31, 2007, 7:56am UTC](https://forum.kirupa.com/t/delete-textfield-instances/227553/1 "2007-05-31T07:56:11Z")

</div>

hi guys,

I am creating this layout where texFields are dynamically placed according to some variable.

```auto

function displayHeadlines():void {
	var j:Number =13;
	var i:int;
	var headlineText:TextField;
	for (i= 0; i<3; i++) {
		headlineText = new TextField();
		headlineText.textColor = 0xFFFFFF;
		headlineText.x = 420;
		headlineText.y = j;
		headlineText.width = 156;
		headlineText.height = 68;
		headlineText.text = "something";
		trace("added button" + j);
		j = j + headlineText.height+8;
		addChild(headlineText);
	}
}
function removeHeadlines():void{
//What would that be? I've tried everything I could find, didn't find much
//I've tried 
//	removeChild(headlineText);
// but this only removes the last child on the loop, how can i remove them all?

}

displayHeadlines();

}

```

Is there a way where I can actually add those textFields in a Sprite maybe, that I can add or clear()?

pls help,

thx
