Re: unsetting object property in AS2
Rich Rainbolt <[email protected]> Sun, 21 Oct 2007 12:27:00 -0700
| Newsgroups | gmane.comp.web.flashcoders.devel |
|---|---|
| Message-ID | <[email protected]> |
Unsubscribe Remove On Oct 19, 2007, at 6:46 PM, Mark Winterhalder wrote: > Andrew, > > you can do 'delete myObject.myProperty', and you may want to look into > linked lists as an alternative to arrays: > <http://en.wikipedia.org/wiki/Linked_list> > > HTH, > Mark > > > > On 10/19/07, Andrew Sinning <[email protected]> wrote: >> 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 >> > _______________________________________________ > Flashcoders mailing list > [email protected] > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders _______________________________________________ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders