The success argument only measures if Flash was able to communicate with the
server side script. It does not have any intelligence as to whether your
server side script failed such as with syntax errors or logic errors.
One technique is to debug your server side script with a plain form or that
sends the data and temporarily write the data back as an html page.
Otherwise you can try to read the error messages in the Flash output window.
--
Lon Hosford
www.lonhosford.com Flash, Actionscript and Flash Media Server examples:
http://flashexamples.hosfordusa.com May many happy bits flow your way!
[quoted text, click to view] "MatMaar" <webforumsuser@macromedia.com> wrote in message
news:e5mlq0$2mu$1@forums.macromedia.com...
Hi All
I got a form made in flash. I want to send my data to a asp page which puts
the data into the DB.
If I get a 'success' in flash it has to move on, otherwise, errorpage will
popup.
What is strange now, is that I (most of the time) get my error message
instead
of a success, while I'm usre asp receives the data, because it puts it in
the
DB...
What can be wrong here?
Tm
ASP:
<%
Option Explicit
dim error
error=isLeeg(Request.Form ("sFirstName")) or isLeeg(Request.Form
("sLastName")) or isLeeg(Request.Form ("sEmail")) or isLeeg(Request.Form
("sSex")) or isLeeg(Request.Form ("sLanguage")) or isLeeg(Request.Form
("sStreet")) or isLeeg(Request.Form ("sNumber")) or isLeeg(Request.Form
("sZip")) or isLeeg(Request.Form ("sLocation")) or isLeeg(Request.Form
("sCountry")) or isLeeg(Request.Form ("A1")) or isLeeg(Request.Form
("A2"))
or isLeeg(Request.Form ("iElimination"))
if not error then
dim getConn
Set getConn = Server.Createobject("ADODB.Connection")
getConn.Open Application("sDBConnect")
dim rs
Set rs = server.CreateObject ("adodb.recordset")
rs.CursorType = 1
rs.LockType = 3
rs.ActiveConnection = getConn
rs.Open "select * from tblParticipation"
rs.AddNew ()
rs("sFirstName") = Request.Form("sFirstName")
rs("sLastName") = Request.Form
("sLastName")
rs("sEmail") = Request.Form
("sEmail")
rs("sSex") =
Request.Form ("sSex")
rs("sLanguage") = Request.Form
("sLanguage")
rs("dBirthDate") =
dateSerial(Request.Form ("iBirthDate_year"),Request.Form
("iBirthDate_month"),Request.Form ("iBirthDate_day"))
rs("sStreet") = Request.Form
("sStreet")
rs("sNumber") = Request.Form
("sNumber")
rs("sBox") =
Request.Form ("sBox")
rs("sZip") =
Request.Form ("sZip")
rs("sLocation") = Request.Form
("sLocation")
rs("sCountry") = Request.Form
("sCountry")
rs("bCheckIN_NL") =
convertBool(Request.Form ("bCheckIN_NL"))
rs("bCheckIN_EM") =
convertBool(Request.Form ("bCheckIN_EM"))
rs("bCheckIN_LCP") =
convertBool(Request.Form ("bCheckIN_LCP"))
rs("dCreatedTS") = now()
rs("A1") =
Request.Form ("A1")
rs("A2") =
Request.Form ("A2")
rs("iElimination") = Request.Form
("iElimination")
rs.Update
rs.Close
set rs=nothing
else
Response.Write "&Error=Verplicht veld niet ingevuld"
end if
function convertBool(value)
if value="1" or value=1 then
convertBool=true
else
convertBool=false
end if
end function
Function convertStr(value)
if not isnull(value) then
convertStr=cstr(value)
else
convertStr=""
end if
End Function
Function isLeeg(value)
isLeeg=false
if trim(value)="" or isEmpty(value) or isNull(value) then
isLeeg=true
End Function
%>
ACTIONSCRIPT:
function postData() {
//get data
var lv:LoadVars = new LoadVars();
var result_lv:LoadVars = new LoadVars();
lv.A1 = _root.answer1;
lv.A2 = _root.answer2;
lv.iElimination = _root.schiftingsvraag;
lv.sFirstName = voornaam_txt.text;
lv.sLastName = achternaam_txt.text;
lv.sEmail = email_txt.text;
lv.sSex = _root.sSex;
lv.sLanguage = _root.sLanguage;
lv.iBirthDate_day = mySubDayNumber;
lv.iBirthDate_month = mySubMonthNumber;
lv.iBirthDate_year = mySubYearNumber;
lv.sStreet = straat_txt.text;
lv.sNumber = huisnummer_txt.text;
lv.sBox = bus_txt.text;
lv.sZip = postcode_txt.text;
lv.sLocation = woonplaats_txt.text;
lv.sCountry = land_txt.text;
lv.bCheckIN_NL = _root.bCheckIN_NL;
lv.bCheckIN_EM = _root.bCheckIN_EM;
lv.bCheckIN_LCP = _root.bCheckIN_LCP;
trace("lv: " + lv);
lv.sendAndLoad("process/getUserData.asp", result_lv, "POST");
//send data
result_lv.onLoad = function(success:Boolean) {
if (success) {
trace("success");
_root.gotoAndPlay("bevest");
_root.etoile.gotoAndPlay("boucle");
} else {
trace("load but error");
movieLoader_mc.loadMovie("error.swf");
}
};
}<b>Text</b><b>Text</b>