The Contact Form in Flash

I’ve completed my intent to stylize my webpage with Flash. I actually spent a good part of this past weekend editing the files… I honestly don’t think it was too difficult but it certainly was time consuming.

The one thing that I had trouble with was the contact page… editing the action scripts several times in order to get it working wasn’t easy. With the help of this zip file, I was able to get it working in just a few minutes. Hopefully it’ll come in handy for someone else.

The php file itself is straight forward. Passing on the values of the name, email, subject and message from the flash input fields to the php form in order to send out the email. However I did edit the following snip of code for the submit button.

on (release) {
if (name eq “” or subject eq “” or message eq “” or email eq “”) {
stop();
} else {
loadVariablesNum(”form.php”, 0, “POST”);
gotoAndStop(2);
}
}

into this:

on (release) {
if (name==”" || message==”" || email==”"){
name = “Your name:”;
message=”Your comments:”;
email=”Your e-mail:”;
}
else{
loadVariablesNum(”form.php”, 0, “POST”);
name = “”
message=”Thank you. Your Message has been sent.”;
email=”";
}
}

The reason for the minor change was becuase I was getting error messages with the “eq” instead of the “||”… It should’ve worked either way but I guess Flash is picky like that…


About this entry