Need help with the Script

Hi everyone,

I have a problem with this script, i want it to goto the failed lable in the layer i have mentioned if the fields are not filled and if it is filled it should goto the sucess lable in the frame. Here is the script i have in the Send button:


 
on (release) {
 if (name eq "" or subject eq "" or message eq "" or email eq "") {
  gotoAndStop("failed");
 } else {
  loadVariablesNum("form.php", 0, "POST");
  gotoAndStop("sent");
 }
}
 
 

I tried it many times and it never worked, it always goes to the 2nd frame no matter what i have done in the form weather i filled it or not.

Kindly help me with this. You can check the fla which is attached.

Thanks,
Regards.