how to use hashcode in Flex 3
Is it possible to us开发者_JAVA百科e object.hashcode mwthod in flex 3? If so, how to use that (like object.hashcode or System.identityHashCode methods in java). Anybody come across this, please give me some samples. Thanks in advance.
There is no hashCode function defined on the AS3 Object
class.
More recent versions of flash.utils
provide a Dictionary
class,which does provide a means to use an instance of an object as a key. You could use this functionality to make an object registry, where you would assign unique keys to your objects. Then you could make your own hash function to compute a hashcode on the unique key.
But if you're just ultimately trying to build a proper hashtable, you should just use the Dictionary
instead of building your own.
精彩评论