PDA

View Full Version : flash lite 2.1 server connection


clodagh
04-17-2007, 02:04 PM
I need to send a few variables to a servlet over a server. getURL() works but it opens up a browser window which i don't want. LoadVars doesn't seem to like me or defining vars that are most certainly there.
So if anyone knows how to stop the browser window from opening, do tell or if they can see why my_lv.mbrId.. is coming up undefined, if tracing the other side of the operator it gives the correct value.

on(press){
var my_lv:LoadVars = new LoadVars();
my_lv.mbrId = mbrId_txt.text;
my_lv.holNo = holNo_txt.text;
my_lv.stroke = stroke_txt.text
my_lv.send("setscore.cfm", "_blank", "POST");

trace(my_lv.holNo+"&"+my_lv.mbrId)

}

sophistikat
04-30-2007, 05:31 PM
i always use sendAndLoad to avoid any windows popup... it will also allow you to debug and see if the LoadVars object was sent.on(press){
var result_lv:LoadVars = new LoadVars();
result_lv.onLoad = function(success:Boolean) {
if (success) {
trace('No errors: send_lv was sent!');
} else {
trace('Error: send_lv was not sent, there was problem connecting to server.');
};

var send_lv:LoadVars = new LoadVars();
send_lv.mbrId = mbrId_txt.text;
send_lv.holNo = holNo_txt.text;
send_lv.stroke = stroke_txt.text
send_lv.sendAndLoad("setscore.cfm", result_lv, "POST");
}