1004: Namespace was not found or is not a compile-time constant.


Description of Error

The compiler can’t find the Namespace you’re referring to.

Adobe’s Official Writeup

The namespace is either unknown or is an expression that could have different values at run time. Check that you are spelling the namespace correctly and that its definition is imported correctly.
(Adobe Error Reference)

Cause of the Error

You’re telling the compiler to use a namespace that it can’t find. For instance,

1
2
3
4
5
6
7
package {
	import flash.display.MovieClip;
	import com.mypackage.namespaces.ns1;
 
       use namespace ns2;
 
       public class...

You’re importing ns1 but attempting to use ns2, which the compiler can’t find.

Solutions to the Error

Make sure that whatever namespace you’re trying to use is imported and doesn’t have any errors whereever you are defining it.

Other Articles About This Error

If you’ve read a useful writeup of this issue elsewhere on the internet, leave a comment and I’ll add it to this list.

  1. No comments yet.

You must be logged in to post a comment.

  1. No trackbacks yet.