var d:Dictionary = new Dictionary(); d["a"] = "b"; d["b"] = "z";
How to get the length/size of the dictionary (which is 2) ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no built-in method to get the size/lenght/count of an AS3 dictionary.
There are workarounds: for example, you can create a custom dictionary class which extends or wraps the
flash.utils.Dictionaryclass, adding the counter functionality. You can manage the count as entries are added/removed, or count on-demand using a simple For loop iteration: