Re: [Flashcoders] dictionary vs array

2008-03-18 Thread Leandro Ferreira
There's also a performance issue there, since some array operations(ie. splice) are more expensive than in dictionaries and some dictionaries operations(ie. for in) are more expensive than array ones. Leandro Ferreira On 3/11/08, Hans Wichman [EMAIL PROTECTED] wrote: On a sidenote, it's

Re: [Flashcoders] dictionary vs array

2008-03-18 Thread Steven Sacks
If you want the best performance you can get: http://lab.polygonal.de/2007/11/26/data-structures-more-on-linked-lists/ His doubly linked list is insanely fast. What I mean is, I had some code that moved non-sequential items around a list. Using an Array, I could easily cause Flash to timeout

[Flashcoders] dictionary vs array

2008-03-11 Thread Dwayne Neckles
can anyone say why dictionary is better than array.. Im seeing it used in alot of papervision examples and i dont get why? I will research this on my own as well.. _ Need to know the score, the latest news, or you need your

Re: [Flashcoders] dictionary vs array

2008-03-11 Thread Steven Sacks
An Array is a linear collection. A Hash is a random access collection (lookup table) of name-value pairs. Dictionary is a fancy Hash that can take an Object as a key, instead of a String, and uses strict (===) equality for its lookups. hash = new Object(); hash.foo = bar; array = new

RE: [Flashcoders] dictionary vs array

2008-03-11 Thread Dwayne Neckles
: Tue, 11 Mar 2008 19:48:45 +0100 From: [EMAIL PROTECTED] To: flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] dictionary vs array CC: [EMAIL PROTECTED]; [EMAIL PROTECTED] Hi, its a conceptual difference, array maps indices to objects, while a dictionary maps objects to objects

Re: [Flashcoders] dictionary vs array

2008-03-11 Thread Steven Sacks
You got it! :) You can mix and match with a Dictionary, as well. You can use strings as keys or objects. Patrick Matte | BLITZ wrote: Thanks Steven, I never really understood what a dictionary was myself, so dictionary would be useful for something like this ? dictionary = new

Re: [Flashcoders] dictionary vs array

2008-03-11 Thread Claus Wahlers
Dwayne Neckles wrote: can anyone say why dictionary is better than array.. Im seeing it used in alot of papervision examples and i dont get why? I will research this on my own as well.. Keys in an Array can be numeric, strings, or both: var a:Array = []; a[0] = something; a[hello] =

Re: [Flashcoders] dictionary vs array

2008-03-11 Thread Cory Petosky
-0200 x214 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steven Sacks Sent: Tuesday, March 11, 2008 12:14 PM To: Flash Coders List Subject: Re: [Flashcoders] dictionary vs array An Array is a linear collection. A Hash is a random access

RE: [Flashcoders] dictionary vs array

2008-03-11 Thread Barry Hannah
Of Patrick Matte | BLITZ Sent: Wednesday, 12 March 2008 8:42 a.m. To: Flash Coders List Subject: RE: [Flashcoders] dictionary vs array Thanks Steven, I never really understood what a dictionary was myself, so dictionary would be useful for something like this ? dictionary = new Dictionary(); button1 = new

Re: [Flashcoders] dictionary vs array

2008-03-11 Thread Hans Wichman
On a sidenote, it's pretty easy to implement for as2 too btw, although the performance is probably not uber. I gotta admit once you get used to object-to-object mapping ... ;) On Tue, Mar 11, 2008 at 9:07 PM, Claus Wahlers [EMAIL PROTECTED] wrote: Claus Wahlers wrote: An associative Array