# Function scope and Events

**URL:** <https://forum.kirupa.com/t/function-scope-and-events/301923>\
**Category:** flash\
**Created:** [December 17, 2009, 7:56pm UTC](https://forum.kirupa.com/t/function-scope-and-events/301923 "2009-12-17T19:56:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RubenFlash](https://avatars.discourse-cdn.com/v4/letter/r/839c29/32.png) [@RubenFlash](https://forum.kirupa.com/u/RubenFlash)\
**Post date:** [December 17, 2009, 7:56pm UTC](https://forum.kirupa.com/t/function-scope-and-events/301923/1 "2009-12-17T19:56:16Z")

</div>

Hi!

If I have something like this…

```auto

function fire():void{
   //do stuff
}

myObject.addEventListener(Event.COMPLETE, fire, false, 0, true);

```

… the event always happens, but if I have something like this…

```auto

function big(){
   function fire():void{
       //do stuff
   }
 
    myObject.addEventListener(Event.COMPLETE, fire, false, 0, true);
}

big();

```

… after a while the event stops firing. Why? It seems to me that the Garbage Collector is eliminating the association between the object and the function, but it could be something else. Also it may have to do with the use of the weak reference in the listener configuration. Any ideas?
