View Full Version : How do you pass a Flash Variable to Classic ASP page?
richo
11-16-2006, 09:56 AM
I've given up on passing a flash variable to an ASP.NET page and have decided to use classic ASP instead!
I understand this would be the actionScript code(?):
var varSend:LoadVars = new LoadVars();
varSend.score= score_txt.text;
varSendsend("setscore.asp", "_blank", "POST")
Also, is it okay to put this on a button?
But how would i receive this in ASP? Anyone have some example code?
Any help mucho appreciated.
var varSend:LoadVars = new LoadVars();
varSend.score= score_txt.text;
varSend.send("setscore.asp");
ASP
myVar = Request("score")
That will set the incoming score variable to myVar
richo
11-16-2006, 04:34 PM
Thanks, looks simple!
richo
11-20-2006, 11:10 AM
It's not working :confused:
At the moment i've put it on the submit button.
on(press){
var varSend:LoadVars = new LoadVars();
varSend.score= score_txt.text;
varSend.send("setscore.asp","_self");
}
the asp:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<% myVar = Request("score") %>
<%Response.Write myVar%>
it just doesn't work! Whyyyy?
few things....
var varSend:LoadVars = new LoadVars();
on(press){
varSend.score= score_txt.text;
varSend.send("setscore.asp","_self");
}
Shouldnt declare LoadVars in an on handler.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"
myVar = Request("score")
Response.Write myVar%>
You need a <% %> for every line. Just the first and last. I would also suggest you read up on Classic ASP and the LoadVars object alittle bit more.
richo
11-20-2006, 03:43 PM
still doesn't work.
i put this "var varSend:LoadVars = new LoadVars();" on the frame and ress on the button press.
Examine:
http://www.actionscript.org/forums/showthread.php3?t=67379
richo
11-21-2006, 08:47 AM
Still doesn't work!!!!
god this is annoying! :mad:
my code seems completely correct but it just isn't working!
on(press){
var varSend:LoadVars = new LoadVars();
varSend.score= score_txt.text;
varSend.send("http://localhost/content/edXtra/christmas2006/setscore.asp","post");
}
ASP still the same.
richo
11-21-2006, 09:26 AM
Problem solved!
The code was actually completely wrong! The code below is the correct method for using loadVars, found in the Flash ActionScript dictionary:
on(press){
var varSend = new LoadVars();
varSend.score= score;
varSend.send("http://localhost/content/edXtra/christmas2006/setscore.asp","_self","post");
}
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.