Actionscript3 compiler: Error 1046 Boolean not found

I found my second compiler bug in flash today.  The first involved an obscure combination of a switch statement and a few other statements in a particular order.  I submitted the fix, including demo code, to adobe last year.

The new bug involves the following error messages:


1046: Type was not found or was not a compile-time constant: Boolean.
1046: Type was not found or was not a compile-time constant: String.

Unlike most compile issues, this one does not provide a line number, so you don’t know where to find the offending code. This fact, combined with not being able to locate internal types, leads me to call this a compiler bug.

The cause appears to be a naming conflict. I had an .as file with an object that is the same name as a movieclip in the library.

The file was intended as a mock object to replace a movieclip that didn’t exist in the test Fla. The as file was located in the root of the app’s directory structure, which worked for testing. The conflict occurred because the main app, which already had the movieclip in the library, saw the .as file in the root and imported it.

The offending one-line .as file is as follows:
var moviename:flash.display.DisplayObject;

When I add or remove that file, the bug appears or disappears.

The compiler should flag this as a naming conflict, possibly pulling up the line of code in the as file.

Tags:

Leave a Reply