Home  |  About  | Last |  Submit  |  Contact
AllQuests.com




Previous Question:  drawing lines with AS vs tweening  Flash ActionScriptNext Question:  Input Boxes  Flash ActionScript
Question Check 2 email address ( Flash Kit Community Forums Flash ActionScript )
Updated: 2010-07-21 05:55:03 (3)
Check 2 email address

Hello.

I have a recomend bit on my site.
I have the script to check one e-mail but I cannot work out how you can check two.

The script I'm using at the moment is:

on (release, keyPress "<Enter>") {
if ((vemail.indexOf("@") != -1) && (vemail.indexOf(".") != -1) && (length(vemail)>5)) {
action = "Send";
loadVariablesNum("membership.php", 0, "POST");
nextFrame();
} else {
vemail = "PLEASE ENTER EMAIL";
action = "";
stop();
}
}





How can I alter this so it would check two ??

The script above checks the - TEXT BOX: "vemail" but i need it to do the same thing with TEXT BOX: "femail" too.


If you want have a look at what I done so far , check http://www.feneo.com (Its at bottom Left)

I'm so stuck. Pleeeeeeeeeease help

Thanks in advance


Dihan.com

Answers: Check 2 email address ( Flash Kit Community Forums Flash ActionScript )
Check 2 email address

if ((vemail.indexOf("@") != -1) && (vemail.indexOf(".") != -1) && (length(vemail)>5)&&(femail.indexOf("@") != -1) && (femail.indexOf(".") != -1) && (length(femail)>5))

have you tried that simple solution?

gparis

gparis

Check 2 email address

Nearly there:

What happens at the moment is that, if one is wrong the other says, both boxes says = PLEASE ENTER EMAIL

What whould be great if they are both independent for them self and check speratly.


This what I'm using now :

on (release, keyPress "<Enter>") {
if ((vemail.indexOf("@") != -1) && (vemail.indexOf(".") != -1) && (length(vemail)>5) && (femail.indexOf("@") != -1) && (femail.indexOf(".") != -1) && (length(femail)>5)) {
action = "Send";
loadVariablesNum("recomend.php", 0, "POST");
gotoAndPlay("andagain");
name.text = "Thank You - Recomendation sent";
} else {
vemail = "PLEASE ENTER EMAIL";
femail = "PLEASE ENTER EMAIL";
action = "";
stop();
}
}


Thanks peeps

Dihan.com

Dihan

Check 2 email address

and if one is ok (some var is true) and the other is not ok (some other var is false) what happens? do you send? or do you send an alert like "please enter valid email" in the appropriate box?
If you do not mind the "appropriate box" just replace && (and) by || (or) between vemail and femail. If not use variables (see above)
and maybe you should put the check on(press) and the result action (loadVariables) etc.. on(release)
gparis

gparis

Previous Question:  drawing lines with AS vs tweening  Flash Kit Community Forums  Flash ActionScriptNext Question:  Input Boxes  Flash Kit Community Forums  Flash ActionScript

- Source: Check 2 email address Flash Kit Community Forums Flash ActionScript
- Previous Question: drawing lines with AS vs tweening Flash Kit Community Forums Flash ActionScript
- Next Question: Input Boxes Flash Kit Community Forums Flash ActionScript