# Listening to Singletons

**URL:** <https://forum.kirupa.com/t/listening-to-singletons/190598>\
**Category:** flash\
**Created:** [June 13, 2006, 12:42pm UTC](https://forum.kirupa.com/t/listening-to-singletons/190598 "2006-06-13T12:42:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JimmyH](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jimmyh/32/1884_2.png) [@JimmyH](https://forum.kirupa.com/u/JimmyH)\
**Post date:** [June 13, 2006, 12:42pm UTC](https://forum.kirupa.com/t/listening-to-singletons/190598/1 "2006-06-13T12:42:53Z")

</div>

Ok… i have a singleton that dispatches events after data withinin it is updated.

My question is… if i want to addEventListeners for these events in several other clases do they get overwritten by type. e.g my singleton dispatches an event of type “update” and i want to listen to this event in two different classe by saying

class1:

```
ActionScript Code:
[FONT=Courier New][LEFT]MySingleton.[COLOR=#000080]getInstance[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR].[COLOR=#000080]addEventListener[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]"update"[/COLOR], Delegate.[COLOR=#000080]create[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]this[/COLOR], [COLOR=#0000FF]this[/COLOR].[COLOR=#000080]method1InClass1[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR];

```

[/LEFT]  
[/FONT]

class2  
ActionScript Code:  
[FONT=Courier New][LEFT]MySingleton.[COLOR=#000080]getInstance[/COLOR]COLOR=#000000[/COLOR].[COLOR=#000080]addEventListener[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]“update”[/COLOR], Delegate.[COLOR=#000080]create[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]this[/COLOR], [COLOR=#0000FF]this[/COLOR].[COLOR=#000080]method1InClass2[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR];

[/LEFT]  
[/FONT]

doesn’t the listener get overwritten due the items having the same type??? or are they OK cos the have different methods listening???

Cheers

james
