Thanks Muzak, I have never used the delete command! I always set references
to null etc.
/David
----- Original Message -----
From: "Muzak" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" <flashcoders@chattyfig.figleaf.com>
Sent: Wednesday, November 09, 2005 4:14 PM
Subject: Re: [Flashcoders] removing a entry from an associative array?
delete??
function removeAssociativeEntry (startArray, entryName) {
delete startArray[entryName];
}
regards,
Muzak
----- Original Message -----
From: "David Skoglund" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" <flashcoders@chattyfig.figleaf.com>
Sent: Wednesday, November 09, 2005 3:50 PM
Subject: [Flashcoders] removing a entry from an associative array?
The only solution I see is to create a new array by looping through the
array like this:
function removeAssociativeEntry (startArray, entryName) {
newarray=[];
for (var i in StartArray) {
if (entryName<>i) {
newarray [i]=startArray[i];
}
}
return (newarray);
}
This seems a bit silly, especially since I don't know how long these
arrays are gonna be. Is thery any inbuilt function for getting the index
of a associative entry?
/David
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders