The standard map/associative-array structure to use in flash actionscript 3?

Posted by tstyle on Stack Overflow See other posts from Stack Overflow or by tstyle
Published on 2010-04-24T20:31:10Z Indexed on 2010/04/24 20:33 UTC
Read the original article Hit count: 156

I'm relatively new to flash, and is confused about what I should use to store and retrieve key value pairs. After some googling I've found various map-like things to choose from:

1) Use a Object:

var map:Object = new Object();
map["key"] = "value";

The problem is that it seems to lack some very basic features. For example to even get the size of map I'd have to write a util method.

2) Use a Dictionary

What does this standard library class provide over the simple object? It seems silly for it to exist if it's functionally identical to Object.

3) Go download some custom HashMap/HashTable implementation from the web.

I've used a lot of modern languages, and this is the first time I haven't been able to find a library implementation of an associative array within 5 minutes. So I'd like to get some best-practice advice from an experienced flash developer.

Thanks!

© Stack Overflow or respective owner

Related posts about flash

Related posts about flex