Creating Anonymous Functions
//Here is the syntax for an anonymous function:
/*
function():datatype {
statements
};
*/
package{
import flash.display.Sprite;
public class Main extends Sprite{
public function Main(){
var fSayHi:Function = function(sName:String):void {
trace("Hi, " + sName);
};
fSayHi("Joey");
}
}
}
Related examples in the same category