1

I get this bug when I use constants as default parameters and want to work around it somehow without having to use literals. Annoyingly, they deffered the bug resolution and I could not find a satisfying solution to this. I suspect an incorrect compile order to be responsible for this issue and think there must be a way to influence it, preferably via compiler options, maybe with a more or less ugly hack.

My idea is to somehow force the compiler to compile the class with the constants that cause the error first, before anything else gets compiled. But I've no idea how to achieve this. So:

Is there any way to influence the compile order of the Flex MXMLC?

Manuel Leuenberger
  • 2,327
  • 3
  • 21
  • 27

1 Answers1

1

Moving constants definition in separate SWC might help.

alxx
  • 9,897
  • 4
  • 26
  • 41
  • Ok, it compiles. But the default parameters that are constants in the SWC are somehow `null`, but tracing them at runtime works just fine. Either I'm missing something or it's the compiler again that screws it up. – Manuel Leuenberger Jul 03 '11 at 22:55
  • When used as default parameter, it's null and when accessed from enclosing class, it's not null? What did you put in the swc? – alxx Jul 04 '11 at 13:38
  • It's null when used as a default parameter, but not null when accessed anywhere else. In the SWC were just the static constants. So I guess it's the same bug as when compiled without using an SWC, except that it compiles, because the constants are already compiled, but when used as default parameters the compiler doesn't see that they are really defined. I gave it up and use the literal notation again, even if it tears my heart apart ;) – Manuel Leuenberger Jul 04 '11 at 14:03
  • Yes, it seems the compiler doesn't bother to resolve symbol dependencies - $init for constants is called later than their use in default params. – alxx Jul 05 '11 at 05:32