Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sending flash variables into a database via asp??? 1

Status
Not open for further replies.

ralphonzo

Programmer
Joined
Apr 9, 2003
Messages
228
Location
GB
no problem fishing info out of a database and using it within flash, but i can't get around the great big error message of "getInfoError" when i try to send info back to the asp script. anybody know where i might be going wrong??

here's the as function:

************************************************************
function sendGameInfo() {
sendvars = new LoadVars();
sendvars.onLoad = function(result) {
if (result) {
records = sendvars.records;
trace("records = "+int(records));
} else {
trace("getInfoError");
}
};
totplayers = int(homeplayers)+int(awayplayers);
sendvars.totloop = totplayers;
v1 = eval("sendvars.batpos");
v1 = batpos[0];
v2 = eval("sendvars.batruns");
v2 = batruns[0];
//sendvars.sendAndLoad("senddata.asp", sendvars, "POST");
}
************************************************************

and here's the asp script:

************************************************************
response.write "records=4"
rs.close
totloop = request.form("sendvars.totloop")
batpos = request.form("sendvars.batpos")
batruns = request.form("sendvars.batruns")
************************************************************

if i just opt to receive the "records" variable without attempting to send anything, there's no problem. i've got to use the "eval" function (i suppose) as i eventually want to loop through the arrays.

this is seriously doing my fruit now, so if anyone has a notion, i'd be pleased to hear it,

thanks for reading (and hopefully helping),

ralph
 
Yes you are a bit messed up there. Try it this way:

Code:
function sendGameInfo() {
    loadInfo = new LoadVars();
    loadInfo.onLoad = function(result) {
        if (result) {
            records = loadInfo.records;
            trace("records = "+int(records));
        } else {
            trace("getInfoError");
        }
    };
	
    totplayers = int(homeplayers)+int(awayplayers);
	
	sendInfo = new LoadVars();
    sendInfo.totloop = totplayers;
	//not sure where you are trying to get these values from, I am assuming an input field
	sendInfo.v1 = batpos.text;
	sendInfo.v2 = batruns.text;
    
	sendInfo.sendAndLoad("senddata.asp",loadInfo,"POST")
    //sendvars.sendAndLoad("senddata.asp", sendvars, "POST");
}

Your ASP should be:

Code:
<%
response.write "records=4"
rs.close
totloop = request.form("totloop")
batpos = request.form("v1")
batruns = request.form("v2")
%>

I think that will do you. Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
nope, any data that is received(?) by the asp file still causes the error message to be thrown up, regardless of how i try to receive the info. this must be a fundamental problem, but i'm buggered if i can see it!

any more ideas?
 
Can you zip and post your project? Would help to see the full picture.

Wow JT that almost looked like you knew what you were doing!
 
thanks for your continuing interest. i've cut down the fla to it's relevent portions including a direct url link for local(ish) testing. it should run (or rather not!) from your machine. i'd rather not post the zipped file though as it contains details that i'd prefer not to divulge (such as the direct url link and db field names). besides, i have no idea how to post a zipped file (not done it before and can't see how to!). any suggestions?
 
Post the files on a server that you have access to. You can't post it to tek-tips directly. Then just paste the link here.

Here is a working example. Extract this zip and create a virtual web called "sendandload" pointed to the extracted files.

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
and here is the link Click Here

Wow JT that almost looked like you knew what you were doing!
 
waddayaknow, it works...well in!
 
you're a superstar. really appreciated, thanks,

kindest regards,

ralph
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top