I've been working on something I call Signals. It's a new approach for AS3 events, inspired by C# events and signals/slots in Qt.
Today I created my first-ever Google Code project:
EDIT: I moved the project to Github. http://github.com/robertpenner/as3-signals
I listed features with short code samples there. I'm having a hard time pasting them into Blogger without re-doing it all. Here are the Concept and Philosophy sections for a start:
- A Signal is essentially a mini-dispatcher specific to one event, with its own array of listeners.
- A Signal gives an event a concrete membership in a class.
- Listeners subscribe to real objects, not to string-based channels.
- Event string constants are no longer needed.
- Composition and interfaces are favored over inheritance.
- Events in interfaces are a good thing.
- Event types are classes, not strings.
- Event classes should focus on the data they contain, not on who sends them.
- Event classes should not contain string constants that various other classes use.
- Test-Driven Development (TDD) is essential and fun.
- So far, not a single static keyword in the source.
- No singletons.
The Project Home Page has the feature listing and code examples.
I want Signals to be really good, and I'm open to changing anything and everything to improve it. So please check it out and post your impressions, critiques and suggestions.