I must be having some crazy brain cramp right now, I'm having a devil of a time
with getting a loop to work properly. I have an ArrayCollection that I need to
get to data a level or two down (root>item>associated>fKey). When I loop thru
it it's fine unless there's only one item in there.. then I get an error. My
brain is fried.. can anyone tell me what the heck I'm doing here?
Thanks
Original XML:
<root>
<item>
<id>1</id>
<associated><fKey>2</fKey><fKey>3</fKey></associated>
<associated><fKey>2</fKey></associated>
</item>
</root>
Loop:
for (var i:int = 0; i < stories.length; i++) {
for (var j:int = 0; j < stories[i].associated.fKey.length; j++)
{
trace(i + " " + stories[i].associated.fKey[j]);
}
}