Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TextInput disapears on "enter"

Status
Not open for further replies.

grovemedia

Technical User
Dec 15, 2003
22
US
Right now i have
on (enter) {
mycode
}
for my textinput. So when i test the movie and i hit "enter" my textinput disapears. Why is this doing this?
 
on (enter){...

Never saw that!
Post more of your code, or better provide a link to your .fla.
 
This is the code for my TextInput(txtName). I just want this code to execute if the user hits enter. But you hit enter and the TextInput box disapears. I can't figure it out. Help!

on (enter) {
var NameLength = txtName.length;
if (NameLength == 0) {
import mx.controls.Alert;
Alert.show("Please Enter Your Name" + newline, "RateWatch Quiz", Alert.OK);
} else {
_global.UserName;
_global.UserName = txtName.text;
_global.Results = new XML();
_global.Results.ignoreWhite = true;
_global.Results.load("file://C:/XML/Results.xml");
_global.Results.onLoad = function(Success:Boolean) {
if (Success) {
trace("Loaded");
} else {
trace("Not Loaded");
}
};
gotoAndStop(2);
}
}
 
I'm still learning, but you might need to use something like this:

if (Key.isDown(Key.ENTER)){
mycode
}

instead of:

on (enter) {
mycode
}

This might give you something to play with until someone more experienced can help. Hope it helps :)
 
Thanks, Appreciate your feedback. I will give that a try.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top