thanks, sorry to be dim, but what exactly do I put as the iterator in
these loops?

for each (<what> in map)

Can I use...

var o:Object;
for each (o in map)?

Incidentally I don't think a Dictionary works in my particular
instance because it uses the strict equality === operator which means
that I can only retrieve items if I have the exact same object that I
used as the key.

In my case I am using a String UID value as the key so I can look up
objects from the map from lots of different places.  I can guarantee
that I will *not* have the same instance of the key object when I look
up the right hand side of the map, instead I have a String which
contains the same characters as the original key.  

So == will work, but === will not, which unfortunately makes the
Dictionary object useless for my purposes.

Simon

--- In flexcoders@yahoogroups.com, "ben.clinkinbeard"
<[EMAIL PROTECTED]> wrote:
>
> for...in and for...each will both work on Object but what you're
> really looking for is Dictionary. Dictionary supports those loops as
well.
> 
> HTH,
> Ben
> 
> 
> 
> --- In flexcoders@yahoogroups.com, "simonjpalmer" <simonjpalmer@>
> wrote:
> >
> > In the absence of a formal Map I am using an object as a key/value
> > pair map as follows:
> > 
> > var map:Object = new Object();
> > map["A"] = some_object_A;
> > map["B"] = some_object_B;
> > map["C"] = some_object_C;
> > 
> > and then looking up by the key
> > 
> > var object_A:Object = map["A"];
> > 
> > etc.
> > 
> > This works really well for random lookup by the key, but what I also
> > need is a way to iterate through the objects I have put on the map
> > object.  
> > 
> > Is there a for each(* in map) construct I can use?  
> > 
> > Does anyone know if there are any plans to support HashMaps in AS3 or
> > flash?  Is there anything synonymous to a HashMap already that I am
> > clearly not aware of?
> > 
> > Thanks
> > Simon
> >
>


Reply via email to