# How to execute callback functions?

**URL:** <https://forum.kirupa.com/t/how-to-execute-callback-functions/308353>\
**Category:** flash\
**Created:** [April 21, 2010, 12:40pm UTC](https://forum.kirupa.com/t/how-to-execute-callback-functions/308353 "2010-04-21T12:40:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Swiftaxe](https://avatars.discourse-cdn.com/v4/letter/s/67e7ee/32.png) [@Swiftaxe](https://forum.kirupa.com/u/Swiftaxe)\
**Post date:** [April 21, 2010, 12:40pm UTC](https://forum.kirupa.com/t/how-to-execute-callback-functions/308353/1 "2010-04-21T12:40:36Z")

</div>

Hi,

How do I execute callback functions dynamically by passing a function in as an argument to another function?

Look at this example:

```auto
package {

public class myClass extends MovieClip {

   public function myClass(callback) {

      this.addEventListener(MouseEvent.MOUSE_UP, mouseUp);

   }

   private function mouseUp(e:MouseEvent) {

      var x = 55; // do some calculation
      // execute callback funtion here with x as an argument

   }

}
}

```

How do I do this?
