# Event Listener listening too well. What's the idea?

**URL:** <https://forum.kirupa.com/t/event-listener-listening-too-well-whats-the-idea/128807>\
**Category:** Uncategorized\
**Created:** [November 16, 2004, 1:37pm UTC](https://forum.kirupa.com/t/event-listener-listening-too-well-whats-the-idea/128807 "2004-11-16T13:37:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DannyBoyInMarse](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@DannyBoyInMarse](https://forum.kirupa.com/u/DannyBoyInMarse)\
**Post date:** [November 16, 2004, 1:37pm UTC](https://forum.kirupa.com/t/event-listener-listening-too-well-whats-the-idea/128807/1 "2004-11-16T13:37:52Z")

</div>

Hi,  
when I use a UI Button Component and I add a listener like this:

[color=blue]myBtnListener = new Object();[/color]  
[color=blue]btnMyButton.addEventListener(“click”, myBtnListener);  
myBtnListener.click = function() {  
trace(“You clicked the button myBtnListener!”);  
doThisFunction();  
}[/color]

The function [color=blue]doThisFunction()[/color] gets call too many times(between 30 et 80times).  
That’s not what I want. Of course I can set a variable that changes at the end of the doThisFunction() call that stops the function being called more than once but I’m just wondering why is this so???  
thanks  
DannyBoyInMarseille
