-
Notifications
You must be signed in to change notification settings - Fork 8
fromEvent
richardszalay edited this page May 17, 2011
·
14 revisions
Creates an Observable sequence from the event values of an IEventDispatcher
static function fromEvent(dispatcher : IEventDispatcher, eventName : String,
useCapture : Boolean = false, priority : int = 0)
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 ──o───o───o───o──
│ │ │ │
output ──o───o───o───o──
IObservable.<Event>
Observable.fromEvent(stage, MouseEvent.MOUSE_MOVE)
.subscribe(function(event : MouseEvent) : void
{
trace("Mouse moved");
});