unsetting object property in AS2

Andrew Sinning <[email protected]> Fri, 19 Oct 2007 09:09:41 -0500
Newsgroups gmane.comp.web.flashcoders.devel
Message-ID <[email protected]>
A question in my sent box from when the list went down:

I like to use the Object class as an index, but there doesn't appear to 
be a way to completely remove a property from an object.  I can set the 
value to null, but I'd really like to be able to remove the property 
completely.  Why? Because if I want to do a reverse lookup, then I have 
to iterate through all of the properties, but having to iterate through 
the nulled values seems inefficient.

I can do this with another class, something that includes an Array to 
keep track of current properties and an Object for the index, but I'm 
wondering if I'm overlooking something.  Often I find that I am.

Speaking of Arrays, it's a bit frustrating that there's no easy way to 
remove an item from an array either.  Currently I use:

   iterate through the array to find the index of the needle
   splice the Array at the index

Is there a faster way to remove an item from an array?


Thanks!
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders