Passing a function as a parameter

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