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

AS 2.0: enumerations?

2004-03-14       - By Darron J. Schall

 Back
Reply:     1     2     3     4     5  

> and, it runs JUST as fast since the compiler knows the value of
OBJTYPE_BOX
> at compile-time, and it replaces all instances of OBJTYPE_BOX with the
value
> 1.

Not true.  The ActionScript compiler doesn't know that OBJTYPE_BOX is a
compile-time constant (i.e., it's value might change during execution).
Therefore, the value of OBJTYPE_BOX needs to be looked up, and it's not just
as fast.

Enums are not supported in AS2, but it's a future reserved word in
ECMAScript 4, so maybe with Flash 8 we'll see them.  Whenever I do
enumerations, I follow this:
http://www.darronschall.com/weblog/archives/000097.cfm

If you want "real" enumerations, write your code with them, and then do a
find/replace before you publish your .swf.

-d



=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
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:106900
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
To unsubscribe send a blank e-mail to:
Normal Mode: flashcoders-unsubscribe@(protected)
Digest Mode: flashcoders-digest-unsubscrive@(protected)