my class has this function:
the thing is, the variables i want to send with my loadVars are dynamic. I want to be able to send any variable i want to the PHP script o my sendForm has to be able to set a variable and then a value to the variable.
however, when i trace sendForm.myName i get undefined and obviously the variables arent getting sent to the script. any ideas?
public function setScript(path:String, variables:Array){
formBTN.onRelease=function(){
var sendForm: LoadVars = new LoadVars();
for(var i=0;i<variables.length;i++){
sendForm.variable = variables*.getVariableName();
set(sendForm.variable, variables*.getVariableValue());
}
sendForm.onLoad=function(success){
if(success){
variables[0].clearField();
_root.temp.text=sendForm.phoneVar;
}
};
sendForm.sendAndLoad(path,sendForm,"POST");
};
}