Getting #1009 error - can't find my error
Hi,
I'm trying to set up a contact form but I get a #1009 error. I read somewhere that it has to do with false targeting but I can't find my error(s). Please help.
// Imports needed for radio button grouping
import fl.controls.RadioButton;
import fl.controls.RadioButtonGroup;
// hide processing CM
processing_mc.visible = false;
// custom function we create to populate the comboBox list
function addPrintsToList ():void {
printList.addItem( { label: "DIBC" } );
printList.addItem( { label: "Fittraketerna" } );
}
// Run function above now
addPrintsToList ();
// make radio button group distictions
var radioGroup1:RadioButtonGroup = new RadioButtonGroup("radioGroupStorlek");
radioSmall.group = radioGroup1;
radioMedium.group = radioGroup1;
radioLarge.group = radioGroup1;
// build variable name for the URL Variables loader
var variables:URLVariables = new URLVariables;
// Build the varSend variable
var varSend:URLRequest = new URLRequest("form_parse.php");
varSend.method = URLRequestMethod.POST;
varSend.data = variables;
// Build the varLoader variable
var varLoader:URLLoader = new URLLoader;
varLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
varLoader.addEventListener(Event.COMPLETE, completeHandler);
// handler for the PHP script completion and return of status
function completeHandler(event:Event):void {
// remove processing clip
processing_mc.visible = false;
name_txt.text = "";
email_txt.text = "";
msg_txt.text = "";
antal.value = 1;
checkbox.selected = false;
// Load the response from php here
status_txt.text = event.target.data.return_msg;
}
// function ValidateAndSend
function ValidateAndSend (event:MouseEvent):void {
// validate fields
if(!name_txt.length) {
status_txt.text = "Var god och fyll i ditt namn.";
} else if (!email_txt.length) {
status_txt.text = "Var god och fyll i din email.";
} else if (!msg_txt.length) {
status_txt.text = "Var god och skriv ett meddelande.";
} else {
// All is good, send the data now to PHP
processing_mc.visible = true;
// ready the variables in our form for sending
variables.userName = name_txt.text;
variables.userEmail = email_txt.text;
variables.userMsg = msg_txt.text;
variables.userPrints = printList.value;
variables.userAntal = antal.value;
variables.userStorlek = radioGroup1.selection.value;
variables.userNewsletter = checkbox.selected;
// Send the data to PHP now
varLoader.load(varSend);
} // close else condition for error handling
} // close validate and send function
Thanks in advance,
Anton
