PDA

View Full Version : How do you Post an ActionScript variable to an ASP.NET 2.0 page?


richo
11-10-2006, 01:00 PM
I've done a flash game with a high score. I want to create a high score table. I have to use ASP.Net to get the details from the person and submit to a table.

So i need to post the score variable to the ASP.NET page but i have no idea how to do this!?

Can anyone help, any help much appreciated.

Cota
11-10-2006, 01:02 PM
YOu can use LoadVars() to send and receive data from your ASP.NET file, or Flash remoting I believe will work in your case as well.

richo
11-10-2006, 01:03 PM
is LoadVars() a .Net function or ActionScript?

Also, what actionscript would i use to send the score to the page?

richo
11-10-2006, 01:22 PM
Okay, i've done this code in the ActionScript of the game:

on(press){
var sendscore:LoadVars = new LoadVars();
sendscore.score = score_txt.text;
sendscore.send("score.aspx","_self", "POST");
}

Does anyone know what ASP.NET 2.0 / C# code i would need to get this value and write it out?

Cota
11-10-2006, 01:47 PM
Dont declare the loadvars object in a button...Also, did a quick google search for your second question
http://www.google.com/search?hl=en&lr=&q=asp.net+request+variable

richo
11-10-2006, 02:51 PM
no luck. I can't work out how to do it. If you know, could you please provide some example code?:confused:

Cota
11-10-2006, 07:52 PM
in classic ASP it was

Variable = Request("VarFromFlash");

richo
11-13-2006, 08:52 AM
Does anyone know the asp.net / c# way of doing this?