Getting data from input text box

i hvae a username inputbox in layer 1 frame 1 witha submit button
on submit button i have the following script
on (release)
{
txt_dynamic._visible=true;
_global.username = inputbox.text;

gotoAndStop(“user_name”);

}

in layer 5 frame 1(“user_name”) i have the follwing script
txt_dynamic.text ="Welcome "+ _global.username;

txt_dynamic is a dynamic textbox
i get the data , values corrctly on clicking the button
problems faced
1)the button when pressed once nothing is displayed , i need to click it second time to get the data from the input field
2)if someother value is enterd in the input box & submit button clicked , the value of dynamic text doesnot change
how do i resolve the following