Hi Again,
Something I might be miss understanding here, but here goes.
The code below doesn’t run how my mind thinks it should. The call back function is being called twice (proved by the print statement) however it is only running the callback function on the item-cape json file and not the shield then the cape.
There are 11 of these JSON files that will be coming from API later, hence why i am only trying to process one at a time. any help would be great!
function preload() {
for (var i = 0; i < 23124; i++) {
itemStore.push(undefined);
}
itemdata = loadJSON('itemData/items-shield.json', _preloadloadItemData);
itemdata = loadJSON('itemData/items-cape.json', _preloadloadItemData);
guiIcons = loadImage('itemData/GuiIcons.png');
}
function _preloadloadItemData() {
//print(itemdata);
for (var i = 0; i < 23124; i++) {
if(itemdata[i] != undefined){
var item = new Item(itemdata[i]);
itemStore.splice(i,1,item);
}
}
}
Thanks
Ryan