# Calling a function

**URL:** <https://forum.kirupa.com/t/calling-a-function/278554>\
**Category:** Uncategorized\
**Created:** [January 1, 2009, 8:01pm UTC](https://forum.kirupa.com/t/calling-a-function/278554 "2009-01-01T20:01:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tyg3r](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/tyg3r/32/1341_2.png) [@Tyg3r](https://forum.kirupa.com/u/Tyg3r)\
**Post date:** [January 1, 2009, 8:01pm UTC](https://forum.kirupa.com/t/calling-a-function/278554/1 "2009-01-01T20:01:28Z")

</div>

Hi, I’ve been using AS2 for quite some time now, and I’m just starting to get to grips with AS3. However, I’m still having a few very basic problems.

All I want to do, is call a function.

This is how I use to do it - AS2:

```auto
function doThis() {
	trace("You just called this function");
}
doThis();

```

Now this is what I’m having a problem with - AS3:

```auto
function doThis(event:MouseEvent):void {
	trace("You just called this function");
}
doThis();

```

I get this error:

> 1136: Incorrect number of arguments. Expected 1.

This function is being called once a button has been pressed, but I wanted to be able to call the function with a little code too, i.e. when the animation starts.

Thank you.

Mark

_Happy New year btw._
