I’m in the process of refactoring a Flex application into a “library project”, and one of the, err, interesting errors I’ve come across involves a function like this:
function spam(eggs:*=undefined):void {
...
}
While it was a “Flex application”, this function compiled without issue… But when I try to build it as a “library project”, the compiler gives me the error:
1047: Parameter initializer unknown or is not a compile-time constant.
So, uuhh… Why? And is there anything I can do to fix that?
There’s a bug in jira (link) that says mxmlc and the flash compiler behave differently when working with parameter initializers. As the library projects are compiled using a different compiler (compc in place of mxmlc) I suspect it might be the same issue.
You can probably change the function to something like this, if you need it to be undefined: