I need help for input-dynamic text
I'm currently developing a game and I have a problem with my input-dynamic text. I'm trying to make my input text appear on other frame whenever I click the button, well, I tried some solutions that I saw here but it really did not well.
This is the first code I used:
stop();
function handleClick(pEvent:MouseEvent):void {
var myfirstVariable = box1.text;
welcome.text = "Welcome to the game " + myfirstVariable;
}
enter_button.addEventListener(MouseEvent.MOUSE_UP, handleClick);
it does work but only on one frame. and this is the code that i am trying to use now:
stop();
var enteredText:String;
welcome.addEventListener(Event.CHANGE, updateString);
function updateString(evt:Event){
enteredText = welcome.text;
}
enter_button.addEventListener(MouseEvent.MOUSE_UP, handleClick);
and on the other frame:
stop();
enteredText = welcome_2.text;
thank you very much for the help ^^