# Reusing Listener functions

**URL:** <https://forum.kirupa.com/t/reusing-listener-functions/246194>\
**Category:** flash\
**Created:** [December 7, 2007, 10:16pm UTC](https://forum.kirupa.com/t/reusing-listener-functions/246194 "2007-12-07T22:16:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hobbbz](https://avatars.discourse-cdn.com/v4/letter/h/54ee81/32.png) [@hobbbz](https://forum.kirupa.com/u/hobbbz)\
**Post date:** [December 7, 2007, 10:16pm UTC](https://forum.kirupa.com/t/reusing-listener-functions/246194/1 "2007-12-07T22:16:10Z")

</div>

Has anyone had any luck reusing listener functions? IE I have a function displayImage(); that I register for displayBtn’s MouseEvent.CLICK but I also want to call that function from some other place in the code.

So far i’ve been doing it by calling it with a new Event such as:  
displayImage(new MouseEvent(MouseEvent.CLICK)); so that it won’t complain that it doesn’t have the arguments it requires. But I feel this sin’t the best solution.

How have you done it?
