| [ Web Proxy ] |
| Viewing: https://riptutorial.com/actionscript-3/example/9467/the-function-type | [Back] [Original] |
[logo rip]
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.call(), ref.apply(), etc.
And they can be passed in as arguments for parameters whose type is Function:
function test(callback:Function):void {
callback();
}
test(function() {
trace('It works!');
}); // Output: It works!
| Web Proxy Viewer | New URL | Original Page |