-
Notifications
You must be signed in to change notification settings - Fork 8
fromEvents
richardszalay edited this page May 20, 2011
·
2 revisions
Creates an Observable sequence from the event values of several events dispatched by an IEventDispatcher
.
static function fromEvents(dispatcher : IEventDispatcher, eventNames : Array,
useCapture : Boolean = false, priority : int = 0) : IObservable
The useCapture and priority arguments will be used when adding an event listener to dispatcher.
The event listener will be added when a subscription starts and removed if the subscription is cancelled.
The returned sequence does not complete
The returned sequence does not error
event source 1 ──o───────────o──
│ │
event source 2 ──┼───o───o───┼──
│ │ │ │
output ──o───o───o───o──
IObservable.<Event>
Observable.fromEvents(stage, [MouseEvent.MOUSE_DOWN, MouseEvent.MOUSE_MOVE, MouseEvent.MOUSE_UP])
.subscribe(function(event : MouseEvent) : void
{
trace("The mouse did something!");
});