Back in 2001, when I was still doing Java programming, I got tired of writing ad-hoc command line parsing code and wrote a small library to factor out the difficult bits. The Argv library is still available. If you want to know more about the library itself, I recommend the Dr. Dobb’s article that describes it.
Although I haven’t gotten around to porting it to ActionScript, Mark Northup has ported it to C++ and was kind enough to provide the sources for that version. They’re now posted to the Argv web page. Thanks, Mark!