bigsigh
04-10-2006, 06:46 PM
Hi, i hope this isnt to simple even for this section but i have tried all the tutorials on loops i could find and cannot achieve what i am aiming for.
the code i have so far is :
myData = new LoadVars();
myData.onLoad = function() {
enterdata();
};
myData.load("gallery.php");
enterdata = function () {
display.addItemAt(0, myData.username0);
display.addItemAt(1, myData.username1);
display.addItemAt(2, myData.username2);
};
it works 100% but i need it to work for any number of usernames that are returned not just for 0, 1, 2, .... etc as i define them.
I think i need a loop in the enterdata function , but im still very much a newbie so not sure if im right. :confused:
Any help would be very greatly appreciated .
Thanks
Simon
the code i have so far is :
myData = new LoadVars();
myData.onLoad = function() {
enterdata();
};
myData.load("gallery.php");
enterdata = function () {
display.addItemAt(0, myData.username0);
display.addItemAt(1, myData.username1);
display.addItemAt(2, myData.username2);
};
it works 100% but i need it to work for any number of usernames that are returned not just for 0, 1, 2, .... etc as i define them.
I think i need a loop in the enterdata function , but im still very much a newbie so not sure if im right. :confused:
Any help would be very greatly appreciated .
Thanks
Simon