Я хочу создать вложенные массивы. Вот мой код, после того как я загрузил xml.
function readXML(event:Event):void
{
_data = new XML(event.target.data);
for each (var usr in _data.item)
{
allUserbase.push({name: usr.@name,state: usr.@state,
complex: usr.complex,image:usr.@image, link: usr.@link});
for (var k:int = 0; k< allUserbase.length; k++){
trace(k, allUserbase[k].complex);
for (var t:int = 0; t< allUserbase[k].length; t++){
trace(k,t, allUserbase[k][t]);
// this part when i try to built 2d array doesnt work.. :(*/
}
Вот мой XML:
<content>
<item image="John.jpg" name="John" state = "New Jersey" >
<complex fid = "0"> mg749</complex>
<complex fid = "1"> ks749</complex>
<complex fid = "2"> ks678</complex>
</item>
<item image="Smith.jpg" name="Smith" state = "California">
<complex fid = "0"> we649</complex>
<complex fid = "1"> sd449</complex>
<complex fid = "2"> df459</complex>
<complex fid = "3"> hj569</complex>
</item>
<item image="Smith.jpg" name="Mike" state = "New York">
<complex fid = "0"> 8794</complex>
<complex fid = "1"> 4384</complex>
</item>
</content>;