PDA

View Full Version : Passing variables from Flash to ASP and back again...


mrand01
07-12-2003, 06:26 PM
OK, tell me whats wrong, because I don't know


stop();

myLoadVars = new LoadVars();
mySendVars = new LoadVars();

mySendVars.first = "Mike";
mySendVars.last = "Randolph";
mySendVars.send("http://192.168.1.102/ASPFlashTest/name.asp",this,"POST");

myLoadVars.load("http://192.168.1.102/ASPFlashTest/name.asp");
myLoadVars.onLoad = function() {
name_txt.text = this.firstname + " " + this.lastname;
}


ASP

<%
Dim firstname
Dim lastname

firstname = Request.Form("first")
lastname = Request.Form("last")

Response.Write "&firstname=" + firstname + "&lastname=" + lastname
%>

All this is supposed to do is transfer my name to ASP, and have ASP send it back again with different variable names...not a difficult task, but for some reason it doesn't work (i know this is pointless, but this is my way of testing stuff so I can use it at work)

CyanBlue
07-12-2003, 08:00 PM
Howdy... ;)

This looks somewhat similar to your previous question... If it is, please keep them in one thread... If not, nevermind on what I just said... :D

Try this script... You don't need to use send() and load() function to perform that task... Use sendAndLoad() function instead... ;)stop();

mySendVars = new LoadVars();

mySendVars.first = "Mike";
mySendVars.last = "Randolph";
mySendVars.onLoad = function() {
name_txt.text = this.firstname + " " + this.lastname;
}
mySendVars.sendAndLoad("http://192.168.1.102/ASPFlashTest/name.asp", mySendVars, "POST");

mrand01
07-13-2003, 02:59 AM
thanks mang, learn something new every day (or every 6 hours)