how to iterate model list in flex as3 My code:
var list:ArrayList=new ArrayList();
var per:Person=new Person();
per.person_id=1;
per.fname="james";
per.userid="12";
list.addItem(per);
for each (var p:Person in list)
{
trace("name----------"+p.fname);
}
but the above iterator not working... how can iterate this?
Instead of for each you can try normal for loop
for(var i=0; i<list.length; i++)
{
var p:Person = Person (list.getitemAt(i));
trace(p.fname);
}
this will work fine...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With