I’m trying to build a dynamic array.
I can’t figure out how to increment my variable name.
I’ve been sitting here a long time and it feels like my eyes are bleeding… LOL
springArray[arrayIndex] = [phpIndex+i];
When I use this is outputs NAN, I dunno what that is.
I want to increment phpIndex1 to phpIndex2 then 3 then so on…
Here’s the full code.
result_lv = undefined;
var result_lv:LoadVars = new LoadVars();
result_lv.onLoad = function(success:Boolean) {
if (success) {
mystatus.text = result_lv.wrote;
springArray = new Array();
arrayIndex = 0;
phpIndex1 = result_lv.c1;
phpIndex2 = result_lv.c2;
phpIndex3 = result_lv.c3;
i = 1;
do {
springArray[arrayIndex] = [phpIndex+i];
i++
arrayIndex++;
result_lv.myIndex = result_lv.myIndex-1;
} while (result_lv.myIndex-1 ne 0)
// populate the listbox with the data
for(i=0;i<springArray.length;i++) {
spring.addItem(springArray*[0], springArray*[1]);
}
} else {
mystatus.text = “Error connecting to server.”;
}
};
var send_lv:LoadVars = new LoadVars();
send_lv.id = _global.primary_key;
send_lv.sendAndLoad(“http://localhost/Contacts/selectFly.php”, result_lv, “POST”);