Compile Error #5000
#5000
I ran across an issue concerning compile error #5000: The class ‘fl.containers.UILoader’ must subclass ‘flash.display.MovieClip’ since it is linked to a library symbol of that type.
I’d seen this before, but not with a built in component. After my google foo brought me round and back twice I finally ran across a page where the user had created two functions with the same name. Changing the function name fixed the compile error. It’s too bad the compile error that was fixed was not related to the actual problem. So I considered similar options in my case.
My solution: CamelCase your class names. The original developer had set a bunch of MovieClips to export for actionscript, however he had used all lower case letters. CamelCasing the class names fixed the compile error.
Let’s look at the normal case that this error shows up in.
You create a movie clip in your library. In the properties, you select ‘export for actionscript.’
Then you create a .as file for that movie clip but extend Sprite instead of the expected MovieClip.
Make sure when exporting a movie clip in your library for actionscript that the external .as class file you make extends the same class that you have referenced in the library.
