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

checking multiple conditions

Status
Not open for further replies.

Hskrdoo

Programmer
Aug 27, 2001
13
0
0
US
I have a question that probably has a pretty simple answer, I just can't come up with it. I have a movie clip offstage that says:

onClipEvent (keyDown) {
tellTarget ("_root") {
if (Key.getCode() == 112) {
play ();

This says that if the user press F1, play. But I also need to check the condition of an input text box. I need to tell Flash "If textbox A equals 100, and the user press F1 then play. But if textbox A doesn't equal 100, don't play (even if F1 is pressed). What do I have to add to my script? Any help is greatly appreciated.
 
You need to use an "and" condition:

if (Key.getCode() == 112 && textBoxA=="100") {
play ();
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top