module events { export class EventDispatcher { listeners:any = {}; dispatchEvent(event: any): void { var e:Event; var type: string; if (event instanceof Event) { type = event.type; e = event; } else { type = event; e = new Event(type); } if(this.listeners[type] != null){ e.currentTarget = this; for (var i:number = 0; i < this.listeners[type].length; i++){ var listener: EventListener = this.listene