# Using a button's function on INIT

**URL:** <https://forum.kirupa.com/t/using-a-buttons-function-on-init/319197>\
**Category:** Uncategorized\
**Created:** [February 11, 2011, 9:06pm UTC](https://forum.kirupa.com/t/using-a-buttons-function-on-init/319197 "2011-02-11T21:06:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kill\_robot\_kill](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kill_robot_kill/32/359_2.png) [@kill\_robot\_kill](https://forum.kirupa.com/u/kill_robot_kill)\
**Post date:** [February 11, 2011, 9:06pm UTC](https://forum.kirupa.com/t/using-a-buttons-function-on-init/319197/1 "2011-02-11T21:06:14Z")

</div>

Sorry, I am a total AS3 noob.  
I am creating a small file, using procedural programming, not ready for OOP.

I have button that adds a MC to the stage from the library. Is there a way to re-use the same function on page load?

```auto

function addCard(evt:Event):void
{
	//do stuff
	addChild(card);
}
mybutton.addEventListener(MouseEvent.MOUSE_UP, addCard);

```

is there a way to re-use addCard()? AS2 allowed for just calling the function

```auto

// doesn't work
addCard();

// not sure what to use for this, or if that will even work
addEventListener(??, addCard);

```
