well - if it's an associative array, then the name of the element is its index, so that answers your second question. And if you set the element to undefined, you will get the same result as the loop you are doing...

startArray[entryName] = undefined;

(also, perhaps your code works but I'm not aware that <> is a valid operator in Flash - generally you'd use != instead)

- Nils.


David Skoglund wrote:

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




--


-----------------------------------------------------------------------
Nils Millahn
Internet Solutions - Design and Development - Flash Specialist

T: +44 (0) 7909 528 617
E: [EMAIL PROTECTED]
W: www.hub124.co.uk

=======================================================================
Notice of Confidentiality.

This transmission is intended for the named recipient only. It contains 
information which may be confidential and which may also be privileged. Unless 
you are the named addressee (or authorised to receive it for the addressee) you 
may not copy or use it, or disclose it to anyone else.

It is the responsibility of the recipient to ensure that the forwarding, 
opening or use of the e-mail (and any attachment) will not adversely
affect their system or data. Please carry out appropriate virus checks.
=======================================================================


_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to