# Anon Function: interesting

**URL:** <https://forum.kirupa.com/t/anon-function-interesting/327634>\
**Category:** flash\
**Created:** [March 15, 2012, 6:14pm UTC](https://forum.kirupa.com/t/anon-function-interesting/327634 "2012-03-15T18:14:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cbeech](https://avatars.discourse-cdn.com/v4/letter/c/e99b99/32.png) [@cbeech](https://forum.kirupa.com/u/cbeech)\
**Post date:** [March 15, 2012, 6:14pm UTC](https://forum.kirupa.com/t/anon-function-interesting/327634/1 "2012-03-15T18:14:01Z")

</div>

There was a thread the other day that was discussing the value/practice of using anonymous functions in Event Listeners - can’t seem to find it at the moment - but i was just working on a quick temporary call in testing, and noticed something i thought interesting (probably not lol) - after bangin my head against the wall for a bit 😉

it seems that if you use weak references with the declaration that it kills the anonymous function - but inconsistently, you may be able to hit it a few times before it no longer operates - i would assume that it’s getting GCed - but i’m pretty sure the listener is still assigned to the member object, just the function is getting killed - seems odd

i thought that this was info that i haven’t run across before and thought i’d point it out - it very well may be known and only new to me… lol 😃
