scusate ragazzi, ma non riesco proprio a capire il perché!!!
ho questo semplice codice che carica dei nomi da un file php, il passaggio funziona, va tutto, solo che non so perchè la visibilità della variabile tot scompare quando faccio il for !!!!!
se faccio un trace sopre mi dice "undefined".....perché ???
Codice PHP:
var getParties:Object = new LoadVars();
_global.partiesData = new Array();
function MyLoadVarsOnLoad() {
tot = this["total"];
if (tot<1) {
trace("no data");
} else {
partiesData["total"] = this["total"];
for (i=1; i<=tot ; i++) {
partiesData["name_"+i] = this["name_"+i];
trace(partiesData["name_"+i]);
}
}
}
function LoadData() {
getParties.load("http://localhost/prova_sito/web/local.php");
}
getParties.onLoad = MyLoadVarsOnLoad;