I just spent the last 30 minutes wanting to pull an Office Space on my computer. It all boiled down to odd behavior related to setting the class path in Flash CS3. Allow me to save you from a similar frustration:

Let’s say I have an .fla located in “com.natejc.display.utils”. Since I’ll be using other classes in different packages, I set my class path to “..\..\” to get me back to the “com.natejc” level.

Now let’s say that this .fla contained a MovieClip in the Library that was linked to a class called “ImageLoader” in the “com\natejc\display\utils\” folder. So, I naturally set the linkage properties of this MC to “com.natejc.display.utils.ImageLoader”. Upon compiling, Flash kicks out the following error message:

5001: The name of package ‘com.natejc.display.utils’ does not reflect the location of this file. Please change the package definition’s name inside this file, or move the file. C:\src\com\natejc\display\utils\ImageLoader.as

What!? Yes it does! They match perfectly!! Well, I finally discovered that if I moved the ImageLoader.as file to any other location and changed the linkage appropriately, everything worked great.

Conclusion: If a class lives in the same location as the .fla file, the linkage is always simply the class name without any package prefix, regardless of what your class path is set to or how deep the file actually exists within this path.

However, this means that the movieclip in my library can never be copied and pasted into a different library without someone remembering to change the linkage. C’mon Adobe, even if it is in the same folder, I should still be able to utilize my class path and specify the full package in my MovieClip Linkage.

This work, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial 3.0 United States License.