# Call to function issue

**URL:** <https://forum.kirupa.com/t/call-to-function-issue/282592>\
**Category:** flash\
**Created:** [February 24, 2009, 12:14am UTC](https://forum.kirupa.com/t/call-to-function-issue/282592 "2009-02-24T00:14:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jasonlijw](https://avatars.discourse-cdn.com/v4/letter/j/f6c823/32.png) [@jasonlijw](https://forum.kirupa.com/u/jasonlijw)\
**Post date:** [February 24, 2009, 12:14am UTC](https://forum.kirupa.com/t/call-to-function-issue/282592/1 "2009-02-24T00:14:11Z")

</div>

Hey folks,

I need to call the function onClick before or after the eventListener is enabled. I tried just using onClick(); but I get error 1136: Incorrect number if arguments.

The eventListener is inside a for loop if that matters.

```auto
 
onClick();
 
for(var i:int = 0; < labelArray.length; i++){
typeButtonBack.addEventListener(MouseEvent.CLICK, onClick);
 }
function onClick(event:MouseEvent):void {
  Do something();
}

```

Thanks for the help

Jason
