You can use associative arrays because I don't think you can check the length of a Dictionary object. However, you can extend the dictionary class and add this functionality and override the appropriate methods.
Alternatively, you can scroll it every time to get a length that is not really a good idea, but affordable.
var d:Dictionary = new Dictionary(); d["hi"] = "you" d["a"] = "b" for (var obj:Object in d) { trace(obj); } // Prints "hi" and "a"
You can also look here for information on using "setPropertyIsEnumerable", but I find this more useful for objects than for a dictionary.
nevets1219
source share