Topic: interaction between chumby and server
new to chumby and flash, so please bear with me.
i am trying to modify the menu code that raffaele sena put up as a template. specifically, the code that places several menu items on the screen, and when the user selects an item there is a trace command that displays which item was selected. i'm trying to extend that functionality by communicating that choice to a server. here's how i modified the onMenuSelect function:
function onMenuSelect(i:Number) {
trace("select " + i);
var loader:LoadVars = new LoadVars();
if (i == 0)
loader.load("http://<<server>>/cgi-bin/choice1.py");
if (i == 1)
loader.load("http://<<server>>/cgi-bin/choice2.py");
if (i == 2)
loader.load("http://<<server>>/cgi-bin/choice3.py");
if (i == 3)
loader.load("http://<<server>>/cgi-bin/choice4.py");
loader.onLoad = function (success) {
if (success) {
trace(loader.getBytesLoaded());
} else {
trace("FAIL!");
}
}
}
on my end, i have a python CGIHTTPServer that i'm running. i can see when the program is actually sending requests to the server. the weird behavior i can't explain is that when i launch the program for the first time and select each item, i see requests being sent to the server. but after each of the four items has been selected once, no more requests get sent to the server.
the functionality i want is for the python scripts on my server to be called once every time that the item was selected. what am i doing wrong?
thanks!