views:

6932

answers:

5

One thing I really like about AS3 over AS2 is how much more compile-time type-checking it adds. However, it seems to be somewhat lacking in that there is no type-checked enumeration structure available. What's a good (best / accepted) way to do custom enumerated types in AS3?

+4  A: 

your answer after the jump :-)

Enumerations with classes

Sebastien Benmbarek
Good answer, thanks!
HanClinto
+7  A: 

Just wanted to share my way

LiraNuna
A bit verbose, but I like it.
Rytmis
+1  A: 

Check this out: http://flexblog.faratasystems.com/?p=242

Yakov Fain
+1  A: 

I know, this is a little outdated and does not exactly answer your question, but you might wanna check out haXe. You can also use it to generate as3 for you, plus there are many other reasons to use it. But this'd really get off topic...

back2dos
Cool, thanks for the suggestion!
HanClinto
+1  A: 

Here's one pretty thorough Enum implementation: http://scottbilas.com/blog/ultimate-as3-fake-enums/

Tomislav Pokrajcic