Mailing List
Home
Forum Home
Flash Pro
Subjects
Subject: RE: Firework Effect
Web Service Results
Flash Interface with 10mb xml file
AW: [Flashcoders] Switch/Case vs If/else
AW: [Flashcoders] Switch/Case vs If/else
Flash MX 2004 Sucks
Reading and displaying RSS feeds in Flash MX
Flash and QuickTime VR
Textfield prototype question
XML to Object help
Order of events per frame
MX2004 Dataset itemClassName
memory management removeMovieClip /
Event Dispatcher between classes
Help: MX 2004 How to script a print button to print the entire sli
ScrollPane component doesn 't auto update
setInterval bug identified and fixed
setInterval bug identified and fixed
Listener Object 's best practice
 
RE: AS 2.0 optimising..

RE: AS 2.0 optimising..

2004-03-16       - By Jim Cheng

 Back
Reply:     1     2     3     4     5     6     7     8  

Metanet Software wrote:

> so, what am i missing? because it seems to me that arrays are sort of
> useless...

Arrays offer some additional functionality over using Objects
in certain cases (numerical indexing, sorting, usage as a stack
or queue, string expansion and concatenation).  In these usages,
the native methods are typically quicker than anything written
in AS or even hand-coded FLASM, though this may vary for edge
cases like specialized sorts.

However, if you simply need a dictionary (a.k.a. asssociative
array), an Object works just as well with less cruft.  Besides,
you have the added advantage of being able to hide certain
entries with the undocumented ASSetPropFlags method.

I tend to go with using Objects when I need a dictionary in AS,
though Arrays certainly do have their uses in certain cases,
say, string replacement:

  newText = oldText.split('search').join('replace');

It's basically a matter of selecting the best tool for the job.

Regards,
Jim

=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Supported by Fig Leaf Software
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Be sure to check the archives and the wiki:
http://chattyfig.figleaf.com/
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
http://chattyfig.figleaf.com/cgi-bin/ezmlm-cgi?1:mss:107118
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
To unsubscribe send a blank e-mail to:
Normal Mode: flashcoders-unsubscribe@(protected)
Digest Mode: flashcoders-digest-unsubscrive@(protected)