Help with name game needed

Hi,

I am trying to make a simple game that does this:

There is an input box called firstname. Next to it there is an enter button and when they click it it shows them their new name. This is the way it is now, but its not working:

On the frame that has the enter button in it I have this code:


[left]
//These are defined arrays of different "nicknames"
_root["a"] = ["Awesome","Annoying","A-word-here"];
_root["b"] = ["Behemoth","Boring","Big"];
//And so on...
function changeName(s){//create a function for your cause
s2 = _root[s.substr(0,1).toLowerCase()];//get the array to open
r = random(s2.length);//Choose a random nickname number
_root.outputbox = s2[r]+s; // Take the nickname number from the array and add it onto the string
}[/left]

On the enter button itself I have this code:


[left]on (release) {
	gotoandplay(123);
	changeName(_root.firstname);//name of input text box
}[/left]

On frame 123 I have a some animations that play, then the dynamic text box for the output is at frame 196, but it doesn’t display anything.

Does anyone know what I am doing wrong?

Thanks, Matt