AS 2.0: enumerations? 2004-03-14 - By Darron J. Schall
Back > 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)
|
|