# Dynamically add TextInput on button click

**URL:** <https://forum.kirupa.com/t/dynamically-add-textinput-on-button-click/149300>\
**Category:** flash\
**Created:** [May 27, 2005, 5:00pm UTC](https://forum.kirupa.com/t/dynamically-add-textinput-on-button-click/149300 "2005-05-27T17:00:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![goldleader](https://avatars.discourse-cdn.com/v4/letter/g/a5b964/32.png) [@goldleader](https://forum.kirupa.com/u/goldleader)\
**Post date:** [May 27, 2005, 5:00pm UTC](https://forum.kirupa.com/t/dynamically-add-textinput-on-button-click/149300/1 "2005-05-27T17:00:37Z")

</div>

Ok, here is another question everyone knows the answer to but me, 'cause I’m just starting with Flash. I have a Button instance in a movie object. On Release, I want that button to add a TextInput field to the movie. I have been trying all kinds of code and I can’t get it to show up. Here is the code I have so far:

on (release) {  
this.\_parent.createClassObject(mx.controls.TextInput,“projectName”,this.getNextHighestDepth());  
projectName.move(400,400);  
projectName.setSize(50,15);  
}

What doesn’t this add a TextInput field to the movie? Thanks for your help. You guys rock!
