Wednesday, July 07, 2010

Flex Builder Error 1046: "Type was not found or was not a compile-time constant"

Problem:
While editing a big .as file in Flex Builder 3, the compile is broken suddenly. Got this error:
1046: Type was not found or was not a compile-time constant: ?????.


Cause:
Seems like Flex editor tend to wrongly remove import statement at the top of .as file without user consent.

Solution:
Disable Flex Builder feature:
Windown > Preferences > Flex > Editors > ActionScript Code, uncheck "Remove unused imports when organizing"

No comments: