错误1026收在ActionScript 3甚至与构造函数是一个实例方法是一个、函数、实例、错误

2023-09-08 15:24:51 作者:深院空巷锁千秋

我有一个问题,我的ActionScript类。这是我的code:

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

据生成以下2个错误。

It produces the following 2 errors.

/.../ Main.as,1号线5000:类主必须继承'的flash.display.MovieClip',因为它链接到该类型的库元件 1026:构造函数必须是实例方法

我不知道是什么原因造成的错误,因为做的不是我preSS检查语法。 我使用OSX 10.6.6和Adobe CS 5试用版,如果这些规格有所帮助。

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.

推荐答案

正如我在评论中表示,一个1026的错误通常是与类命名冲突。 主往往是一个很常见的名

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.

 
精彩推荐
图片推荐