Help…
Does anyone know how to add a combo box to a flash form that is using the Flash Mx PHP Mailer by David Khundiashvili. This is a great script but I can’t figure out how to add a Combo Box to it.
I can’t seem to get any variable info for the combo box to link to my PHP script. I’ve tried to get label info and data info but both of them get me nothing.
I’m using the variable [COLOR=seagreen]comboInfo[/COLOR] created for my comboDisplay function. Also, I’m not looking to validate the comboBox.
You can download my files I’m working with from here:
http://home.cogeco.ca/~ravi/
Here is the flash code in my first frame
fscommand (“allowscale”, “false”);
fname1.tabIndex = 1;
lname1.tabIndex = 2;
email1.tabIndex = 3;
telno1.tabIndex = 4;
comments1.tabIndex = 5;
mailform = “mailform.php”;
confirm = “please wait for confirmation …”
action = “send”;
Selection.setFocus(“fname”);
[COLOR=red]//this is my code for the combo box
myData = new Array(‘Rock’, ‘Paper’, '**’ );
for (i=0; i<myData.length; i++) {
comboSelect.addItem(myData, i);
}
function comboDisplay(component) {
[COLOR=seagreen]comboInfo[/COLOR] = component.getSelectedItem().label;
}
comboSelect.setChangeHandler(“comboDisplay”);
// my code ends here[/COLOR]
function validate (address) {
if (address.length>=7) {
if (address.indexOf("@")>0) {
if ((address.indexOf("@")+2)<address.lastIndexOf(".")) {
if (address.lastIndexOf(".")<(address.length-2)) {
return (true);
}
}
}
}
return (false);
}
function formcheck () {
if ((((email == null)) || (email.length<1)) || (email == “ERROR! Address not valid”)) {
email = “ERROR! Address not valid”;
action = “”;
}
if (!validate(email)) {
email = “Address not valid”;
action = “”;
}
if ((((fname == null)) || (fname.length<1)) || (fname == “ERROR! Address not valid”)) {
fname = “Name required”;
action = “”;
}
if ((((lname == null)) || (lname.length<1)) || (lname == “ERROR! Address not valid”)) {
lname = “Name required”;
action = “”;
}
if ((validate(email)) && (email != “ERROR!”) && (fname != “”) && (lname != “”)) {
action = “send”;
loadVariablesNum (mailform, 0, “POST”);
gotoAndPlay (“wait”);
}
}
stop ();
Here is the PHP script
<?
/******************************************************
** Flash Mx PHP Mailer
** By - David Khundiashvili
** Enter your site details below!
/
// Enter your contact email address here
$adminaddress = “rsingh@microagets.com”;
// Enter the address of your website here include http://www.
$siteaddress =“http://www.ravindersingh.name”;
// Enter your company name or site name here
$sitename = “Ravinder Singh Online Portfolio”;
/
No need to change anything below …
*******************************************************/
$date = date(“m/d/Y H:i:s”);
if ($REMOTE_ADDR == “”) $ip = “no ip”;
else $ip = getHostByAddr($REMOTE_ADDR);
if ($action != “”):
mail("$adminaddress",“Info Request”,
"A visitor at $sitename has left the following information
First Name: $fname
Last Name: $lname
Email: $email
Telephone: $telno
Interest In: [COLOR=seagreen]$comboInfo[/COLOR]
The visitor commented:
$comments
Logged Info :
Date/Time: $date",“FROM:$adminaddress”);
mail("$email",“Thank You for visiting $sitename”,
"Hello $fname,
Thank you for your interest. Someone will contact you shortly
$sitename
$siteaddress",“FROM:$adminaddress”);
$sendresult = "Thank you for your interest and for visiting $sitename. You will be contacted shortly. ";
$send_answer = “answer=”;
$send_answer .= rawurlencode($sendresult);
echo “$send_answer”;
endif;
?>