# Passing a function as a parameter

**URL:** <https://forum.kirupa.com/t/passing-a-function-as-a-parameter/258604>\
**Category:** Uncategorized\
**Created:** [April 25, 2008, 4:09pm UTC](https://forum.kirupa.com/t/passing-a-function-as-a-parameter/258604 "2008-04-25T16:09:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pier25](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@Pier25](https://forum.kirupa.com/u/Pier25)\
**Post date:** [April 25, 2008, 4:09pm UTC](https://forum.kirupa.com/t/passing-a-function-as-a-parameter/258604/1 "2008-04-25T16:09:04Z")

</div>

I’m trying to do something like this and it doesn’t work, but I get no errors.

callback = function(){  
//bla bla bla  
}

another\_function(callback);

function another\_function(parameter:Function){  
an\_object.anEvent = parameter; //so that when this happens the callback function is triggered  
}

Is this supposed to work??

TIA
