I try to load array result generated from php.
The PHP result are as follows :
Title0=1&Comments0=HOME&Title1=6&Comments1=ABOUT&Title2=2&Comments2=SOLUTIONS&menu=3
I use this following code in Flash and work successfully :
myData = new LoadVars();
myData.load("http://localhost/mytry.php");
myData.onLoad = function(success) {
if (success){
trace ("success");
_root.testing.displayText.text = this["Comments"+2]
}
}
Now, as you know from the result above, I need to create loop in order to show the entire result. I use this code and does not work :
myData = new LoadVars();
myData.load("http://localhost/mytry.php");
myData.onLoad = function(success) {
if (success){
for (var i=0;i<menu.length;i++)
{
var k = _root.navigation.attachMovie("placeholder", "placeholder"+i, i);
k._alpha = 0;
k.displayText.text = menu["Comments"+i];
k._x = Math.round(2 + ((k._width+12)*i));
k._y = 0;
}
trace ("success");
}
}
Obviously the date are successfully loaded, but can someone point me out why the code does not work?
Thanks a lot