Calculating Dictionary length in Flex
问题 What's the best way to calculate the length of a Dictionary object in Flex? var d:Dictionary = new Dictionary(); d["a"] = "alpha"; d["b"] = "beta"; I want to check the length which should be 2 for this Dictionary. Is there any way to do it other than looping through the objects? 回答1: No, there is no way to check the length of an object(Dictionary is pretty much an object that supports non-String keys) other than looping through the elements. http://www.flexer.info/2008/07/31/how-to-find-an