Being a huge C/C++ fan, I had a really hard time switching to AS3 and giving up most of C++’s power features as enumerations.
I was surprised that a programming language that is based on Java and C# doesn’t support native enumerations built in the language. After a quick look-up at various Google searches, turns out no one has implemented a type-safe assignable enumerations design pattern in AS3. The various code examples I’ve seen were either not type safe or not assignable (using the enumerations as ‘global’ consts). Since those were not the behaviors I wanted, I had to write my own.
Continue reading