# (AS2) Transfer input text to a dynamic textbox?

**URL:** <https://forum.kirupa.com/t/as2-transfer-input-text-to-a-dynamic-textbox/309488>\
**Category:** flash\
**Created:** [May 17, 2010, 1:22am UTC](https://forum.kirupa.com/t/as2-transfer-input-text-to-a-dynamic-textbox/309488 "2010-05-17T01:22:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DragoonZ50](https://avatars.discourse-cdn.com/v4/letter/d/edb3f5/32.png) [@DragoonZ50](https://forum.kirupa.com/u/DragoonZ50)\
**Post date:** [May 17, 2010, 1:22am UTC](https://forum.kirupa.com/t/as2-transfer-input-text-to-a-dynamic-textbox/309488/1 "2010-05-17T01:22:52Z")

</div>

I am currently working on a project for my computer programming course, creating an rpg game, and have already ran into a problem i’ve spent a few hours trying to fix; came up with the conclusion I couldnt fix it without help.

I have an input textbox with the instance name of “inputname”. The player is supposed to put his name here and then click a button, instance name continuebtn, that will change to frame two on the scene. Frame two has a dynamic textbox with the name of “greetingtb”.

greetingtb already says 'ahh so your name is ’ and after that I would like to add the name that was placed into inputname. What I thought would work was create a variable with the name of playername. I dont know if i wrote this right, i declared it as my first thing in an action layer:

> var playername = “”

next, on continuebtn, I coded the following:

> on (release){

\_root.gotoAndStop(2);

if ((\_root.inputname.text=“crap”)||(\_root.inputname.text="sh…//and so on. basically, I remove profanity lol//…)){  
playername = “@#$%&”;  
}  
else  
{  
playername=\_root.inputname.text  
}  
}

Basically this is what’s happening now: the word “crap”, which im trying to avoid, inserts itself into inputname after i click on continuebtn. why? As I mentioned before, I want the text in inputname, which now should be in playername, to be added into the speech in my dynamic textbox on frame 2. How would i code this?
