I’m trying to create a function that takes a Function as it’s second parameter. I want to be able to give that function a default value as follows:
public function addChangeListener(object:Object, func:Function = defaultUpdate):void
{
var listener:StateManagerListener = new StateManagerListener(object, func);
listeners.addItem(listener);
}
How should I declare the defaultUpdate function to avoid getting the following error?
1047: Parameter initializer unknown or is not a compile-time constant.
Thanks