6

Here is the title error with complete paths:

\\psf\Home\Dropbox\Development\Repositories\GIT\i-cc\Powerhouse\Notes\master\flash\lib\libnote\NotesCore.as:1: 5000: The class 'lib.libnote.NotesCore' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type.

Firstly, what I have tried and what I am using:

  • I am working on this project using FlashDevelop, and FlashDevelop has been set to use an external IDE (Flash CS5.5) - it does not matter whether I use Flash or FlashDevelop to compile/test as the errors still persist.

  • I have also tried un-ticking 'Automatically declare stage instances' in the publish settings without no luck.

  • I have also tried using an absolute path for the extends clause (extends flash.display.MovieClip)

Below is a stubbed version of the NotesCore class;

package lib.libnote {

    /* I am importing MovieClip */
    import flash.display.MovieClip;

    ...

    /* And Extending it to the Class */
    public class NotesCore extends MovieClip {

        /* The following methods/functions are used in the class */

        public function NotesCore() {
            ... 
        }

        public function onAddedToStage(e:Event = null):void {
            ...
        }

        public function init():void {       
            ...
        }

        private function setParams():void {
            ...
        }

        private function onStageResizeLocal(event:Event):void{
            ...
        }

        private function setUpStage():void {
            ...
        }
    }
}

I am mainly from a Java background, so perhaps I am misunderstanding an ActionScript concept; if anybody could point me in the right direction I would be extremely grateful!

chrisburke.io
  • 1,497
  • 2
  • 17
  • 26
  • So the NotesCore symbol has Export for ActionScript and you are using the generated class ? Would it be possible that Flash generates a class at runtime if it's linked to yours, then in FlashDevelop you have your version so there is sort of an ambiguous class referencing going on ? Have a look [here](fhttp://www.flashdevelop.org/wikidocs/index.php?title=AS3:FlexAndFlashCS3Workflow) for some tips, and maybe [this](http://stackoverflow.com/questions/1004867/compile-a-swc-in-flash-for-use-in-flex-with-a-class-written-in-flex/1011662#1011662) might be helpful if that's the case. – George Profenza Sep 05 '11 at 09:57
  • @George Profenza: I believe that the directory structure and the DocumentRoot declarations etc are sane; however the 'linked to a library symbol of that type' part of the error is really throwing me; perhaps something is happening similar to this that I am not seeing. I'll keep looking in the meantime, many thanks! – chrisburke.io Sep 05 '11 at 10:58

7 Answers7

5

For others who find this page, the error

5000: The class '..' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type

often appears when you have other problems somewhere in your project. Look at the Problems tab in Flash Builder and fix any other errors first.

The 5000 error may go away when the other issues are fixed.

SharkAlley
  • 11,399
  • 5
  • 51
  • 42
2

I had this same issue. This might seem stupid (i'm new to AS3), but having this:

class test extends shape {

caused the issue.

I changed it to

class test extends sprite {

and the issue was resolved.

teynon
  • 7,540
  • 10
  • 63
  • 106
0

For others who may come across this:

Am doing an assignment for my university course and so am very new to flash. The error went away for me after I added extends flash.display.MovieClip to the end of my class declaration.

For example:

public class MyClassName extends flash.display.MovieClip
Niall C.
  • 10,878
  • 7
  • 69
  • 61
Fauxpas
  • 86
  • 6
0

If you want to add the other functionality (onAddedToStage() etc), extend the class coming from the swc. Something like:

public class NotesCoreEx extends NotesCore
{
...
}
ekad
  • 14,436
  • 26
  • 44
  • 46
mckenneth
  • 1
  • 1
0

Just change the type of symbol accordingly. This was a quick way I get rid of my 'error 5000''s.

MovieClip to Button or Graphic // Button to MovieClip or Graphic // Graphic to MovieClip or Button

0

In one of your library classes (prob an SWC), do you have an asset with the export name of NotesCore? I think the compiler's getting mixed up here - It's trying to resolve 2 separate classes with the same name.

If you want to add the other functionality (onAddedToStage() etc), extend the class coming from the swc. Something like:

public class NotesCoreEx extends NotesCore
{
...
}
divillysausages
  • 7,883
  • 3
  • 25
  • 39
  • Perhaps I am misunderstanding your answer but I have no assets with the name NotesCore. How can I check the assets export name? I've duly noted your recommendation to extend the NotesCore class. Many thanks! – chrisburke.io Sep 05 '11 at 13:43
  • The "since it is linked to a library symbol of that type" line is telling me that somewhere, in your fla, i think you have a MovieClip that is set to export with the linkage name "NotesCore", which is causing the problem – divillysausages Sep 05 '11 at 13:58
  • have you tried this: http://stackoverflow.com/questions/4265607/unable-to-solve-flash-error-5000-the-class-must-subclass-flash-display-movi ? – divillysausages Sep 05 '11 at 14:04
  • just been through everything and nothing is exporting with the name 'NotesCore' -- also I have tried the example given in the link above. Many thanks! – chrisburke.io Sep 05 '11 at 15:04
  • 2 final suggestions then: the first one is to try `public dynamic class NotesCore extends MovieClip` (it's a long shot); the second is to try and separate out the NotesCore class to another project - remove everything and just get it to compile on its own using your graphics. If something crazy is going wrong I usually try and get a basic project with the problem separate. If you get that and it's still not working, post the project and I'll take a look at it – divillysausages Sep 05 '11 at 15:25
  • So many thanks for your continued efforts; unfortunately setting the class as dynamic did not suppress the error. I'll start trying to move everything into new classes and will post tomorrow on how it turns out. Will need to get clearance before I can post the project. Many thanks again! – chrisburke.io Sep 05 '11 at 15:44
  • you don't need to post the project - just create very basic representations of what you're trying to do: i.e. in Flash, create a new file, create a box and give it an export name of NotesCore. Then create a new code project and try and use it. If it's still going crazy, post that small project – divillysausages Sep 05 '11 at 16:17
0

Check your Action script settings and the path. There are chances that it may not be pointing to the correct file.

achand8238
  • 124
  • 6