# Dynamicly creating a text area onclick as 3

**URL:** <https://forum.kirupa.com/t/dynamicly-creating-a-text-area-onclick-as-3/323825>\
**Category:** Uncategorized\
**Created:** [July 20, 2011, 7:30am UTC](https://forum.kirupa.com/t/dynamicly-creating-a-text-area-onclick-as-3/323825 "2011-07-20T07:30:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![christopherm](https://avatars.discourse-cdn.com/v4/letter/c/e99b99/32.png) [@christopherm](https://forum.kirupa.com/u/christopherm)\
**Post date:** [July 20, 2011, 7:30am UTC](https://forum.kirupa.com/t/dynamicly-creating-a-text-area-onclick-as-3/323825/1 "2011-07-20T07:30:43Z")

</div>

I am newbie to as 3 and flex. I want to add a text area on the click or a button .ie lets say if a person has multiple address and they want to ad more address. When the click add address a new text are should appear.

Hear is the code that I have tried (and this could be very wrong)

private function createTextField():void{  
var theTextField:TextField = new TextField();  
theTextField.type = TextFieldType.INPUT;  
theTextField.border = true;  
theTextField.x = 10;  
theTextField.y = 10;  
theTextField.multiline = true;  
theTextField.wordWrap = true;  
addChild(theTextField);  
}

\<mx:FormItem\>  
\<mx:Button label=“Add Text Area” click=“createTextField();”/\>  
\</mx:FormItem\>

thanks in advance to anyone who can help:).
