Hey, Newgrounds.
I haven't been 'round these here parts in a long time, but I recently started developing a flash game and everything was going swimmingly. I have random enemy generation down, a full on options menu with a lot of variables to control what you encounter within the game, and the story pretty planned out
Only one problem. I can't get the name entry for the character down. I have a text field and you can type in it and converts its contents to a string to be stored for later use in the game, but it keeps adding an extra line to the string. Making it kind of useless to use in dynamic text. This is the code I have.
function Submit(ev:MouseEvent):void
{
Input.toString()
myText = Input.text
trace(myText)
}
Basically, when the "Submit" button is clicked, this function begins. The Text Field (Instance Name "Input") is converted to a string and myText is a string that becomes equal to that input. The next step, I have the script output the contents of myText. This would be fine, far as I can tell except it adds an additional line beneath.
For example, if I put the name "Bill" in the box and click the submit button, it actually outputs:
Bill
(Extra Line here)
If I click the submit button again:
Bill
(Extra Line)
(Extra Line)
I can't see that working out for whenever I call that string to be used in a dynamic text. Any ideas of how I can fix it up?