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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listening for ENTER

Status
Not open for further replies.

ccie9545

Instructor
Aug 28, 2002
134
US
I am having trouble trying to get on object to listen for and react to the user hitting the ENTER key. There is an input text box in frame one of the main timeline. I would like to have this text compared to a variable that I have created when the user hits ENTER. I have pretty much gotten the comparing part down, thanks to rgStewart, it the hitting ENTER part that i can't get down. I know that the comparing code isn't in here, but I have been just trying to narrow down the problem, by working with the least amount of code as possible. Am I on the right track? I have tried

_root.onKeyDown = function (){
x = Key.getAcii();
if (x = 13){
_root.myMovie.gotoAndPlay(5);
}
else {
_root.myMovie.gotoAndPlay(10);
}
}

I am VERY new at this, so I could be completely wrong. I have tried to look at different tutorials and what not, but just can't seem to get it right.

Also, while on the subject. What exactly is the Key.ENTER constant used for?

Thanks in advance...... Erik Rudnick, CCIE No. 9545
mailto:erik@kuriosity.com
 
Try replacing this:

if (x = 13){

with this:

if (x == 13){
 
oh yeah, cause using a single = sign is for defining the value of a variable, right.. and using == is to set a condition of two values being equal.. Erik Rudnick, CCIE No. 9545
mailto:erik@kuriosity.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top