A
ahanix1989
Guest
Ok, Flash gets a list of variables from PHP, in the form of "folder1", "folder2", etc.
How can I create a loop that will populate a listbox with these variables?
I basically have this:
vehiclelist.addItem(folder1, folder1);
vehiclelist.addItem(folder2, folder2);
vehiclelist.addItem(folder3, folder3);
vehiclelist.addItem(folder4, folder4);
vehiclelist.addItem(folder5, folder5);
and so on. I can have a variable, J, tell it how many "folders" there are... but how I I have it use the actual variables?
I realized how confusing this all sounded.
I have a bunch of variables. folder1, folder2, up to a certain value, J. So if J is 6, the last folder is folder6. how can I create a loop in Flash MX that will keep adding folder1, folder2, etc... up until it reaches J?
or alternatively worded, when it does folder plus i, how do I get it to treat that as the variable folder4 instead of the text folder4
Solved.
j = counting;
for (i=1;i<j; i++){
vehiclelist.addItem(this["folder"+i], this["folder"+i]);
}
stop();
How can I create a loop that will populate a listbox with these variables?
I basically have this:
vehiclelist.addItem(folder1, folder1);
vehiclelist.addItem(folder2, folder2);
vehiclelist.addItem(folder3, folder3);
vehiclelist.addItem(folder4, folder4);
vehiclelist.addItem(folder5, folder5);
and so on. I can have a variable, J, tell it how many "folders" there are... but how I I have it use the actual variables?
I realized how confusing this all sounded.
I have a bunch of variables. folder1, folder2, up to a certain value, J. So if J is 6, the last folder is folder6. how can I create a loop in Flash MX that will keep adding folder1, folder2, etc... up until it reaches J?
or alternatively worded, when it does folder plus i, how do I get it to treat that as the variable folder4 instead of the text folder4
Solved.
j = counting;
for (i=1;i<j; i++){
vehiclelist.addItem(this["folder"+i], this["folder"+i]);
}
stop();