开发者

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

开发者 https://www.devze.com 2023-04-02 05:38 出处:网络
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.libnot

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;

  开发者_C百科  ...

    /* 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!


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.


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.


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
{
...
}


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


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


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

public class NotesCoreEx extends NotesCore
{
...
}


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

精彩评论

暂无评论...
验证码 换一张
取 消