PDA

View Full Version : Need a Flash form debugged


pwhannel
04-08-2008, 07:56 PM
1) Project Details: (be as specific as possible):

I have a Flash site, it's really simple (a "coming soon" placeholder), with an input form that I want emailed to myself. I already have the layout and the Actionscript in place, but something isn't working. It may be in the Actionscript or the PHP mail script. All I need is someone (proficient in both Flash and PHP) to go over the code, find the problem, and fix it. We're talking maybe ~100 lines of code total here, again it's very simple.

2) Payment Amount:

$50 USD

3) Payment method/ details (Paypal, check? Timeline?):

Prefer to send check, will create a Paypal account if totally necessary (I don't have one). Payment sent *immediately* on successful execution.

4) Additional Info (about project or potential bidders):

Please help! This probably wouldn't take an experienced coder more than 15 minutes to fix. My client wants it live by tomorrow, so there's a short turnaround time! PM me your email address and I'll send you the files. (Flash CS3, Actionscript 2.0).

tagnu
04-08-2008, 08:04 PM
1) Project Details: (be as specific as possible):

I have a Flash site, i.

Hi can I see the code?

pwhannel
04-08-2008, 08:15 PM
Can I see the code?

Sure. I have several input boxes with different variable names in the design. Five frames (spaced out) that have action associated with them, for the verification code. Here are all the frames code:

Frame 1 (labeled form)
stop();
//Path to PHP file
mailform = "http://www.beckygreenwald.com/mailform.php";
//Confirm message to be updated by PHP script
confirm = "Sending Data...";
//Variable definition for PHP if statement
action = "send";
//variable to hold reply from PHP script
answer = "";
//visual movieclip
_root.errorLight._visible = false;
//sendMail function
function sendMail() {
action = "send";
loadVariablesNum("http://www.beckygreenwald.com/mailform.php", 0, "POST");
trace( firstname )
gotoAndPlay("wait");
}
trace("after sendmail function definition");
//Form field input check
function checkInput() {
if (input1.text == "") {
input1.text = "Name required";
answer = "You must enter your name.";
_root.errorLight._visible = true;
gotoAndPlay("error");
} else if (input3.text == "") {
input3.text = "Email required";
answer = "A valid email is required.";
_root.errorLight._visible = true;
gotoAndPlay("error");
} else {
sendMail();
gotoAndPlay("done");
_root.errorLight._visible = false;
}
}
//Button event to send the data
myButton.onRelease = function() {
trace( firstname )
checkInput();
}
trace("exit form");

Frame 2 (labeled wait)
//recheck to make sure the mailform loaded
trace("enter wait");
trace( firstname );
loadVariablesNum(mailform, 0);
answer = confirm;
firstname = "";
lastname = "";
emailaddress = "";
streetaddress = "";
city = "";
state = "";
zip = "";
phone = "";
trace("exit wait");

Frame 3 (not labeled)
stop();
trace("enter blank");
//check for reply from PHP script
if (answer != confirm) {
gotoAndPlay ("done");
}
trace("exit blank");

Frame 4 (labeled error) and frame 5 (labeled done) have nothing but trace statements inside.

Here's the PHP:

<?

//modify the next 3 lines with your info

$adminaddress = "pwhannel@gmail.com";
$siteaddress ="http://beckygreenwald.com";
$sitename = "Becky Greenwald for Congress";

// Gets the POST Headers - the Flash variables
$action = $_POST['action'] ;
$firstname = $_POST['firstname'] ;
$lastname = $_POST['lastname'] ;
$emailaddress = $_POST['emailaddress'] ;
$streetaddress = $_POST['streetaddress'] ;
$city = $_POST['city'] ;
$state = $_POST['state'] ;
$zip = $_POST['zip'] ;
$phone = $_POST['phone'] ;

//Process and send the information collected
//in the Flash form to Your nominated email address
if ($action == "send") {
mail ("$adminaddress","Info Request",
"A visitor at $sitename has left the following information\n
Action = $action\n
First Name: $firstname\n
Last Name: $lastname\n
Email: $emailaddress\n
Address: $streetaddress\n
City: $city\n
State: $state\n
Zip: $zip\n
Phone: $phone\n
"FROM:$adminaddress" ) ;

//Confirmation is sent back to the Flash form that the process is complete
$sendresult = "Your info has been received.";
$send_answer = "answer=";
$send_answer .= rawurlencode($sendresult);
echo $send_answer;
}


?>

I can also email the files if you like, to get a better look.

tagnu
04-08-2008, 08:18 PM
sure, can you pls mail. I've PMd u.

pwhannel
04-08-2008, 08:19 PM
Here's the errors the Flash Debug Player gives me, as well as the traces. A _changed variable causes an error for each character entered in the form when testing. No email is sent (altho a few did randomly send last night during testing, but with none of the variables inserted).

after sendmail function definition
exit form
Warning: onSetFocus is not a function
Warning: _level0/:firstname_changed is not a function
Warning: _level0/:firstname_changed is not a function
Warning: _level0/:firstname_changed is not a function
Warning: _level0/:firstname_changed is not a function
Warning: _level0/:firstname_changed is not a function
Warning: _level0/:firstname_changed is not a function
Warning: _level0/:firstname_changed is not a function
Warning: _level0/:firstname_changed is not a function
Warning: _level0/:firstname_changed is not a function
Warning: _level0/:firstname_changed is not a function
Warning: _level0/:firstname_changed is not a function
Warning: _level0/:firstname_changed is not a function
Warning: _level0/:firstname_changed is not a function
Warning: onKillFocus is not a function
Warning: onSetFocus is not a function
Warning: _level0/:lastname_changed is not a function
Warning: _level0/:lastname_changed is not a function
Warning: _level0/:lastname_changed is not a function
Warning: _level0/:lastname_changed is not a function
Warning: onKillFocus is not a function
Warning: onSetFocus is not a function
Warning: _level0/:emailaddress_changed is not a function
Warning: _level0/:emailaddress_changed is not a function
Warning: _level0/:emailaddress_changed is not a function
Warning: _level0/:emailaddress_changed is not a function
<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Trajan Pro" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">Testfirstname</FONT></P></TEXTFORMAT>
<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Trajan Pro" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">Testfirstname</FONT></P></TEXTFORMAT>
enter wait
<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Trajan Pro" SIZE="12" COLOR="#000000" LETTERSPACING="0" KERNING="0">Testfirstname</FONT></P></TEXTFORMAT>
exit wait
done
Warning: Not a known player download type, http://www.beckygreenwald.com/mailform.php
Warning: Not a known player download type, http://www.beckygreenwald.com/mailform.php

pwhannel
04-08-2008, 08:22 PM
Sent, thanks!

pwhannel
04-10-2008, 02:51 AM
Tagnu did a fantastic job.