How do you find the length of an Associative Array?

How do you find the length of an Associative Array? The standard “arrayName.length” returns 0.

Cheers,
c

var len=0;
for (prop in arrayName) len++;

trace("arrayName length is "+ len);

Thanks mate!