I recently started a project of converting an older flex app to an AIR app. This app has to scan through a bunch of files, and classify certain types of media based on the location and file extension. Then it saves a manifest of the media to an xml file that can be loaded (without scanning every time).
I started out with a Kind class (think CollectionEventKind) that had the types as strings… but then I had to figure out how to store the regular expressions to make them easily accessible… Then I remembered that while everyone just uses Strings, static const vars can be any class, including it’s own class. So I came up with this class that you can use constants, or locate a specific constant. Code after the fold.
Continue reading →
