Error 1026 Received in ActionScript 3 even with the constructor being an instance method

会有一股神秘感。 提交于 2020-01-06 12:50:13

问题


I have got a problem with my actionscript class. This is my code:

package {
    import flash.display.MovieClip;
    public class Main extends MovieClip
    {
        public function Main()
        {
            ...
        }
    }
}

It produces the following 2 errors.

  • /.../Main.as, Line 1 5000: The class 'Main' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type.
  • 1026: Constructor functions must be instance methods.

I don't know what is causing the errors as the do not when i press Check Syntax. I am using OSX 10.6.6 and Adobe CS 5 Trial Edition if those specs help.


回答1:


As I indicated through the comments, a 1026 error is commonly a naming conflict with the class. "Main" tends to be a very common name.



来源:https://stackoverflow.com/questions/5201804/error-1026-received-in-actionscript-3-even-with-the-constructor-being-an-instanc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!