So far, each thing in edges is an empty object, so there is nothing to iterate. How do the items get into the edges sub-objects?
________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of TCash21 Sent: Tuesday, May 08, 2007 2:04 PM To: [email protected] Subject: [flexcoders] Re: Actionscript accessing array of objects problem _edges[item.id] = new Object(); This is not my code by the way, I'm using someone else's. --- In [email protected] <mailto:flexcoders%40yahoogroups.com> , "Alex Harui" <[EMAIL PROTECTED]> wrote: > > How do you populate edges? > > ________________________________ > > From: [email protected] <mailto:flexcoders%40yahoogroups.com> [mailto:[email protected] <mailto:flexcoders%40yahoogroups.com> ] On > Behalf Of TCash21 > Sent: Tuesday, May 08, 2007 12:48 PM > To: [email protected] <mailto:flexcoders%40yahoogroups.com> > Subject: [flexcoders] Actionscript accessing array of objects problem > > > > Hi all, > I'm having a problem accessing the items in an "array of Items" > Here's the code that initializes it > > private var _edges: Object = new Object(); // map of id -> (map of id > -> 0) > > Here's the function that returns the array > /*** Get an array of all the items that a given item is linked to. > * > * @param id any String > * > * @return an array of Items > */ > > public function neighbors(id: String): Object { > return _edges[id]; > } > > I've tried using > for each (var i:Item in items.neighbors(id)) > { > statements... > } > > I can't seem to access the items at all. I've also tried omitting the > 'each'. > > Any ideas? > Thank you! >

