I have attached a simple file that I can’t get to work.
I can use simple imput fields and use if () to check them easy enough.
But with this I have a drop down box for user names,
and a input component set as a password field.
I just need a simple
if (user == "Cathy" && pass =="cat"){
play();
}
But I dont know how to check == against the fields in the drop down list and text field.
Any help would be much appreciated…
Link to .fla
http://home.iprimus.com.au/c_schultz/help.zip
Edit:
I know it is not secure, and I will be changing it to a PHP mysql set up but for the time being it will do.
system
July 16, 2004, 2:38am
2
user.getSelectedItem ()
if (user.selectedItem.label == "Cathy" && pass =="cat"){
play();
}
system
July 16, 2004, 5:07am
3
Thanks for the hit Phlashman but I couldn’t get it to work.
I tried
on (keyPress “<Enter>”) {
user.getSelectedItem ();
if (user.selectedItem.label == “Cathy”){
play();
}
}
But no joy…
There must be something simple I am over looking…
system
July 16, 2004, 8:11am
4
Still trying…
on(click){//on (keyPress “<Enter>”) {
// *************************
function comboDisplay (component) {
combo = component.getSelectedItem().label ;}
//**************************
user.setChangeHandler (“comboDisplay”) ;
//**************************
if (combo == “Cathy”){
_root.play();
//}
}
But still can’t get it to work
system
July 16, 2004, 12:59pm
5
yes it is. Put the code from post 3 (shown at the top right of the post) and instead of doing play(), do _root.play. very simple ovelook
system
July 16, 2004, 2:30pm
6
I still can’t get it to work… And I have tried everything I can think of…
It is only 1 frame, and both the drop-down menu (user), and button are on _root.
I found that play() wouldn’t work, and that _root.play() did, hence the change.
The following code will play, but if I remove the // it won’t…
on(click){
//user.getSelectedItem ();
//if (user.selectedItem.label == “Cathy”){
_root.play();
}
//}
I have spent hours and hours on this, seached Google back to front, searched F1 inside out and still can’t get it to work.
I would give up and go to your normal client/password PHP mysql check. But I also have a messageboard I am working on and it will have a country drop-down list so I need to be able to work out what is selected so I can pass it to PHP.
Thanks for your help so far though
system
July 16, 2004, 3:04pm
7
**FAR OUT… ** I knew it was somthing simple…
on(click){
toss = _root.user.getSelectedItem().label ;
if (toss == “Cathy”){
_root.play();
}
}
For reasons I don’t know you have to assign getSelectedItem() to a var.
And even though it is in the _root. and you are calling the _root. you have to direct it to _root.
Anyway thanks for your snipt of code… Without it I would still be pulling my hair out !