action script question
Here is some code I'm using to pass variables to PHP and back to flash:
stop();
//=================================
// INIT
//=================================
path = "http://www.geft-online.org/CommandSchedule/"; //declare path to php files
lvOut = new LoadVars(); //create lv object
lvIn = new LoadVars(); //create lv object
lvIn.onLoad = function (success) {
if(success){
//PHP variable value to textbox
output.text = lvIn.message;
if (lvIn.message == 0) {
this.gotoAndStop("success");
}
else {
this.gotoAndStop("3");
}
}else{
//...or notify of failure
//this.gotoAndStop("2");
output.text = "fail";
}
}
//=================================
// BTN CODE
//=================================
submit.onRelease = function(){
//assign user-input value to lv property called years
lvOut.studentname = studentname.text;
lvOut.ipinfo = ipinfo.text;
lvOut.ipemail = ipemail.text;
lvOut.modchange = modchange.text;
lvOut.scheddate = scheddate.text;
lvOut.modreq = modreq.text;
lvOut.reqdate = reqdate.text;
lvOut.reqtime = reqtime.text;
lvOut.course = course.text;
lvOut.team = team.text;
lvOut.reason = reason.text;
lvOut.notes = notes.text;
lvOut.what = "Submit";
//get results returned to lvIn
lvOut.sendAndLoad(path + "changeform.php", lvIn, "GET");
};
reset.onRelease = function() {
studentname.text = "";
ipinfo.text = "";
ipemail.text = "";
modchange.text = "";
scheddate.text = "";
modreq.text = "";
reqdate.text = "";
reqtime.text = "";
course.text = "132T";
team.text = "1";
reason.text = "Cancelled";
notes.text = "";
};
It is successfully returning the variable message(number). I want it to evaluate that number, and then go to the appropriate frame. I'm pretty new to actionscripting, but it seems like this shouldnt be too difficult. I'd appreciate anyones pointers. I'm sure it might be something minor...Thank you in advance!
|