View Full Version : ASP Form from Flash
wish7
December 26th, 2003, 05:18 PM
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?
λ
December 26th, 2003, 05:44 PM
Post your Flash code, and we might be able to help ;)
norie
December 26th, 2003, 05:49 PM
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.
wish7
December 26th, 2003, 07:55 PM
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 = "";
}
}
norie
December 26th, 2003, 08:49 PM
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 '[code]' tags around your actionscript when posting, it makes it easier to read for us :beam:
wish7
December 29th, 2003, 02:03 PM
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!
Digitalosophy
December 29th, 2003, 06:27 PM
http://www.kirupa.com/developer/actionscript/forms_database.htm
wish7
December 29th, 2003, 06:44 PM
I already looked at that tut, but it doesn't tell you how to keep the window from popping up!
Digitalosophy
December 31st, 2003, 02:54 AM
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");
wish7
December 31st, 2003, 03:54 PM
I stand corrected! Thanx!
Digitalosophy
December 31st, 2003, 04:27 PM
No problem, i didn't know what you meant at first or I would have just said this from the beginning. :)
Happy New Year!!!!!
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.