Hey,
Another quick question.
I have code for the user to enter their name in a text box. Once the submit button is clicked I want the name entered to be dispatched with an event as well as displayed on the stage. The reason I want the text field input name to be dispatched is because the text box to enter your name is on the main menu which is loaded and unloaded in order to play through various games.
Below is the code to enter your name into the text box.
var NameTextField:TextField = new TextField();var MyFormat:TextFormat = new TextFormat();
MyFormat.size = 20;
NameTextField.defaultTextFormat = MyFormat;
NameTextField.type = TextFieldType.INPUT;
NameTextField.x = 338;
NameTextField.y = 279;
NameTextField.width = 125;
NameTextField.height = 25;
NameTextField.restrict = "A-Z,a-z, ";
NameTextField.maxChars = 13;
addChild(NameTextField);
SubmitButton.addEventListener(MouseEvent.CLICK, SubmitClicked);
function SubmitClicked(e:MouseEvent)
{
//
SubmitButton.visible = false;
NameBox.visible = false;
}