ActionScript 3 Types The Function type


Functions are of the type Function:

function example():void { }
trace(example is Function); // true

They can be referenced by other variables with the type Function:

var ref:Function = example;
ref(); //, ref.apply(), etc.

And they can be passed in as arguments for parameters whose type is Function:

function test(callback:Function):void {

test(function() {
    trace('It works!');
}); // Output: It works!