wish7
December 26, 2003, 9:18pm
1
Hi everyone…I hope everybody had an excellent Christmas!!! I loved the time spent with my family!!!
Anyways, I created a form in Flash to put information into a database. It works fine except for the processing page pops up everytime I submit. What do I do to stop this?
system
December 26, 2003, 9:44pm
2
Post your Flash code, and we might be able to help
system
December 26, 2003, 9:49pm
3
use sendAndLoad instead of just send. I had the same problem.
just use the process page to report back wether or not the info was entered correctly.
system
December 26, 2003, 11:55pm
4
Here is the code in the flash doc:
function onClick(btn) {
if (btn == submit_btn) {
getURL("…/processForm.asp", 0, “POST”);
gotoAndStop(“thanx”);
} else if (btn == reset_btn) {
fName = “”;
lName = “”;
email = “”;
comments = “”;
}
}
system
December 27, 2003, 12:49am
5
sendVars = new LoadVars();
getVars = new LoadVars();
getVars.onLoad = function(success){
if(success){
if(this.entered == "true"){
gotoAndStop("thanx");
}else{
trace("Data Entered Succesfully");
}
}else{
trace("ASP Error");
}
}
submit_btn.onRelease = function() {
sendVars.fName = fName;
sendVars.lName = lName;
sendVars.email = email;
sendVars.comments = comments;
sendVar.sendAndLoad("../processForm.asp", getVars, "POST");
};
reset_btn.onRelease = function(){
fName = "";
lName = "";
email = "";
commments = "";
}
make sure your asp page returns a value for entered of true if the data was entered correctly and false if not.
edit: please use ’
' tags around your actionscript when posting, it makes it easier to read for us :beam:
system
December 29, 2003, 6:03pm
6
Thanx norie, but whne I entered that code nothing happened. Am I supposed to change anything? I have been looking at it in an attempt to understand. I am pretty new at the actionscript. What exactly is this code saying and doing?
I really prefer the:
actionscript:
submit_btn.onRelease = function() {
sendVars.fName = fName;
sendVars.lName = lName;
sendVars.email = email;
sendVars.comments = comments;
sendVar.sendAndLoad("…/processForm.asp", getVars, “POST”);
};
reset_btn.onRelease = function(){
fName = “”;
lName = “”;
email = “”;
commments = “”;
It gives me a better understanding of how things work. Thank you so much for the help!
system
December 29, 2003, 10:27pm
7
system
December 29, 2003, 10:44pm
8
I already looked at that tut, but it doesn’t tell you how to keep the window from popping up!
system
December 31, 2003, 6:54am
9
*Originally posted by wish7 *
**I already looked at that tut, but it doesn’t tell you how to keep the window from popping up! **
ahh but yes it does my friend, your using getURL. the tut states you should use loadvariableNum
loadVariableNum("../processForm.asp", 0, "POST");
system
December 31, 2003, 7:54pm
10
I stand corrected! Thanx!
system
December 31, 2003, 8:27pm
11
No problem, i didn’t know what you meant at first or I would have just said this from the beginning.
Happy New Year!!!