How can I assign a default value for a function parameter of type Class in Action script 3
public function foo(param:Class = ????? )
{
}
Thanks
You can't, but here's a workaround to achieve the same effect:
public function foo(param:Class = null ):void
{
if(!param)
{
// this'll be your default class
param = MyClass;
}
// here you can do: var bar:* = new param();
}