Object.length? [AS2]

Sometimes I have to keep an array of objects but use variable or strings for element keys. So I simply make an object and add properties to it:

var obj:Object = new Object;
obj["A"] = "asdf";
trace(obj["A"]); //displays "asdf"

I was wondering if there was any way to determine the number of elements in the object without actually having to loop through them and count.

var count:Number = 0;
for (var i in obj)
{
count++;
}
trace(count);

I’ve written a HashTable class (with the same functions as the one in C#) to handle most of this for me, but naturally it won’t be as efficient as just plopping things directly into an object. I don’t think there’s any property for this, but I figured it doesn’t hurt to ask.

Actually, if you guys want I could post the class I wrote. It also has some basic indexing functionality to it for fast lookups by type.