What is AS3-Signals?
AS3-Signals (or ‘signals’ for short) is a proven alternative to the native AS3 event system.
You can see that only line 4 is different.
//CREATE _person = new Person("Sam"); //LISTEN _person.addEventListener(PersonEvent.GREETED, _onPersonGreeted); //CALL _person.greet("Hello!");
//CREATE _robot = new Robot("Robot"); //LISTEN _robot.signal.add(_onRobotSignalGreeted); //CALL _robot.greet("It is me, the Robot!");
What about the speed of AS3-Signals vs Events?
See this image from Ross Gerbasi showing a comparison in milliseconds (lower # is better/faster).
AS3-Signals and Robotlegs
I am a big fan of the Robotlegs framework for AS3. I’ve written about it many times. AS3-Signals is a completely separate project, but WOW these two play really nice together. In my series of custom project templates I created a specific Robotlegs w/ AS3-Signals Template. On a recent client project I chose Robotlegs and added in the optional AS3-Signals project.
- Checkout the proof that AS3-Signals are FASTER than events!
- Read this good article and code on AS3-Signals for Robotlegs.
- See this nice overview of AS3-Signals
- Checkout the HD Tutorial Video and full source code for this post (See ‘Member Resources’ below).