Simple question. I'm looping through the for loop below:
PHP Code:
function LoadXML(e:Event):void {
xmlData=new XML(e.target.data);
for (var i:int = 0; i < xmlData.tab.length(); i++) {
tab(i).text=xmlData.tab[i].@title;
}
}
I have dynamic text fields named tab0, tab1, tab2 etc.
Where it says tab(i) in the code I want it to say "tab" and then the iteration. So the first time the loop fires i=0 so it would be:
tab0.text=xmlData.tab[0].@title;
the second time i=1 so it would be:
tab1.text=xmlData.tab[1].@title;
the third i=2 so it would be:
tab2.text=xmlData.tab[2].@title;
and so on.
I've tried various ways of getting the i value in there which didn't work. Any ideas?