Ok, here’s the dilemma that i hope someone might be able to help me with. I am creating a contact form that will collect user data that is to be passed to a .php script that will then create and store the info in an .xml formatted file for accessing later.
I was trying to use the loadVariables function to pass the information to my .php script, but I kept receiving an error message in the output window saying that there was an error accessing the URL of my .php script (absolute URL used, not relative). So I decided to try the LoadVars method to send my data to my .php script, however I’m a bit confused about something.
I have created 5 input boxes in my .fla for storing my data and I have given them the variable names (variable name, not instance name) of:
firstName
lastName
phoneNumber
emailAddr
schoolName
I then enclosed all of my input boxes into a movieclip which I gave the instance name of form. Since I have given my input boxes variable names, I am confused as to how I should refer to them in the LoadVars ActionScript. Should I refer to each of them by the variable name that I have assigned to each box?
var myVars = new LoadVars();
form.myVars.firstName = firstName;
form.myVars.lastName = lastName;
form.myVars.phoneNumber = phoneNumber;
form.myVars.emailAddr = emailAddr;
form.myVars.schoolName = schoolName;
Or is there another way that I’m supposed to reference my variables inside the form movieclip when using LoadVars?
var myVars = new LoadVars();
form.myVars.firstName
form.myVars.lastName
form.myVars.phoneNumber
form.myVars.emailAddr
form.myVars.schoolName