Interchange Moved
http://binaryexposure.com/interchange. See you there.
Download File:
Hash.as
var myArray:Array = new Array();
myArray["myKey"] = myValue;
and then you can move through the keyList array like you would any other array. Simple.
for(var i:Object in myArray){
var keyList:Array = new Array();
keyList.push(i);
}
package com.neateau.data{
public dynamic class Hash extends Array{
protected var _keyArr:Array;
public function Hash(numElements:int=0){
super(numElements);
this._keyArr = new Array();
}
public function addItem(key:String, value:Object):void{
if(this[key]==null){
this._keyArr.push(key);
}
this[key] = value;
}
public function getItem(key:String):Object{
return this[key];
}
[Bindable]
public function get keys():Array{
return this._keyArr;
}
//this is done to avoid the warning when the keys are bound to something
public function set keys(a:Array):void{}
}
}
And there you have it. A simple Hash class that extends the built in Array functionality and adds in a couple of handy dandy features.