PDA

View Full Version : Flashform to ASP to Flash HELP please


thomaslanger
03-31-2004, 12:59 PM
I need a little help. I have a Flashform which sends data to an ASP script
which is supposed to sent data back to the Flash movie. You can see it at
go to see here (http://www.thomaslanger.dk/Flash) .
It works almost fine when I test it locally with PWS.
But on the server, there is no data-response back to the Flashmovie.

This is the Actionscript code:
submitURL = "http://localhost/Flash/flashformular_send.asp";
function knap_nulstil() {
navn.text = "";
adresse.text = "";
telefon.text = "";
email.text = "";
rejsemaal.setSelectedIndex(0);
sommerkatalog.setValue(false);
vinterkatalog.setValue(false);
kommentar.text = "";
kontakt_brev.setValue(true);
send.enabled = true;
}
function knap_send() {
// oprettelse af en ny LoadVars instance med navnet "formData"
// som indeholder alle data der skal sendes fra formularen
formData = new LoadVars();
// alle variabler fra flashformularen initialiseres
formData.navn = "";
formData.adresse = "";
formData.telefon = "";
formData.email = "";
formData.rejsemaal = "";
formData.sommerkatalog = "";
formData.vinterkatalog = "";
formData.kommentar = "";
formData.kontaktes_via = "";
formData.navn = navn.text;
formData.adresse = adresse.text;
formData.telefon = telefon.text;
formData.email = email.text;
formData.rejsemaal = rejsemaal.getSelectedItems();
formData.sommerkatalog = sommerkatalog.getValue();
formData.vinterkatalog = vinterkatalog.getValue();
formData.kommentar = kommentar.text;
formData.kontaktes_via = kontaktes_via.getValue();
svarData = new LoadVars();
svarData.navn = "";
svarData.adresse = "";
svarData.telefon = "";
svarData.email = "";
svarData.katalog = "";
svarData.onLoad = handleReply;
formData.sendAndLoad(submitURL, svarData, "post");
status.text = "Sender bestilling nu, vent venligst...";
}
function handleReply(success) {
if (success) {
status.text = "Din bestilling er modtaget:\n";
status.text += "Navn: "+svarData.navn+newline;
status.text += "Adresse: "+svarData.adresse+newline;
status.text += "Telefon: "+svarData.telefon+newline;
status.text += "Email: "+svarData.email+newline;
status.text += "Du vil modtage:\n";
status.text += "Katalog: "+svarData.katalog;
} else {
status.text = "Der var problemer med at sende bestillingen. Prøv venligst senere.";
}
}





here comes my ASP code:


<%
Dim svarData_navn, svarData_adresse, svarData_telefon,
svarData_email, svarData_sommerkatalog, svarData_vinterkatalog,

sendTilbageTilFlash
navn = Request("navn")
adresse = Request("adresse")
telefon = Request("telefon")
email = Request("email")
katalog = Request("sommerkatalog")
katalog = katalog & Request("vinterkatalog")

sendTilbageTilFlash =
"navn=" & Server.URLEncode(navn)
& "&adresse=" & Server.URLEncode(adresse)
& "&telefon=" & Server.URLEncode(telefon)
& "&email="&Server.URLEncode(email)
& "&katalog=" & Server.URLEncode(katalog)
Response.Write sendTilbageTilFlash
%>

Of course I did change the submit-address before upload.

Anyone can help, I do appreciate it.
Thomas

hangalot
04-01-2004, 06:05 AM
do u use a relative url?

thomaslanger
04-01-2004, 02:14 PM
no i used an absolute URL, will try with relative.

thomaslanger
04-01-2004, 02:20 PM
did try both now.
still wouldnt work.....

hangalot
04-02-2004, 01:29 AM
put a getURL call which redirects the page tot he desired URL on, that way u will c if it is a page not found error (404), if it is not that then there is a problem with ur page. how u can simulate that to test is the following. call the page in a browser with the values appended in a querystring as follows
http://localhost/Flash/flashformular_send.asp?adresse=addresse_informasie&email=epos_informasie

then if it theows an error u can handle that.

u can always try to rewrite the loadVars onload function as follows as well

svarData.onLoad = = function(){
if (success) {
status.text = "Din bestilling er modtaget:\n";
status.text += "Navn: "+svarData.navn+newline;
status.text += "Adresse: "+svarData.adresse+newline;
// bla bla
}else{
//bla bla
}
}

where currently u have this line:
svarData.onLoad = handleReply;