Re: [Flashcoders] dictionary vs array

2008-03-11 Thread Hans Wichman
Hi, its a conceptual difference, array maps indices to objects, while a dictionary maps objects to objects. There is no such thing as better, it depends on what you need. greetz JC On Tue, Mar 11, 2008 at 7:02 PM, Dwayne Neckles <[EMAIL PROTECTED]> wrote: > can anyone say why dictionary is bette

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 Arra

RE: [Flashcoders] dictionary vs array

2008-03-11 Thread Patrick Matte | BLITZ
Coders List Subject: Re: [Flashcoders] dictionary vs array 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

RE: [Flashcoders] dictionary vs array

2008-03-11 Thread Dwayne Neckles
ate: 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 >

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 Dictionary

Re: [Flashcoders] dictionary vs array

2008-03-11 Thread Claus Wahlers
Claus Wahlers wrote: An associative Array behaves similar to a Dictionary. (if you are using string keys) Cheers, Claus. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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"] = somethi

Re: [Flashcoders] dictionary vs array

2008-03-11 Thread Cory Petosky
nt:MouseEvent){ > trace(dictionary[event.target]); > } > > > > BLITZ | Patrick Matte - 310-551-0200 x214 > > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steven Sacks > Sent: Tuesday, March 11, 2008 12:14 PM > T

RE: [Flashcoders] dictionary vs array

2008-03-11 Thread Barry Hannah
lf 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

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 Arra

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