2. Who am I?
Freelance Flash Platform consultant
Founding Partner of Project Cocoon Multimedia
Author to “Object-Oriented ActionScript 3.0”
Certified geek
3. What is AS3Signals?
Open source project by Rob Penner
Alternative way to working with events in AS3
Inspired by C# events and Signals/Slots in QT
Lightweight, easy and fast to use
4. Lets get back to basics
> flash.events.EventDispatcher
> flash.events.Event
6. What is wrong with this?
Requires inheritance to dispatch events
Need to subclass Event to pass around data
String references as events rather than objects
Misses basic functionality (remove all listeners etc.)
7. What does AS3Signals do?
Uses composition over inheritance
Doesn’t require subclassing to pass arguments
Listeners subscribe to Objects not a String reference
Can hook up to native Events
8. Signal
Most lightweight Signal class
Passes any number of arguments
Supports optional strong typing for arguments
org.osflash.signals.Signal
10. DeluxeSignal
Does everything Signals does
Adds support for target and signal that dispatched it
Passes GenericEvent to listener
org.osflash.signals.DeluxeSignal
12. NativeSignal
Uses Signal to wrap around native Events
Requires object, event type and event class arguments
Uses IEventDispatcher to dispatch
org.osflash.signals.natives.NativeSignal
14. NativeRelaySignal
Similar to the NativeSignal class
Extends DeluxeSignal
Has its own dispatch code rather than IEventDispatcher
org.osflash.signals.natives.NativeRelaySignal
16. Useful features
removeAll - removes all listeners to a signal
addOnce - fires a signal event only the first time
numListeners - returns how many listeners for a signal
There is experimental event bubbling support
17. How well does it perform?
zero listeners one listener
18. Where can you get it?
github.com/robertpenner/as3-signals
More information
Blog robertpenner.com/flashblog
Forum groups.google.com/group/as3-signals
Twitter @robpenner
19. Questions? Thoughts?
Feel free to get in touch!
Twitter @peterelst
Email peter@project-cocoon.com
Blog www.peterelst.com
Website www.project-cocoon.com