0

我正在尝试使用actionscript应用程序文件而不是mxml文件创建 Flex 项目。

我只是使用这段代码:

package
{   

import spark.components.Application;

    public class Test extends Application
    {       
        public function Test(){
            super();    
        }       
    }
}

但我收到此错误:

TypeError: Error #1007: Instantiation attempted on a non-constructor.
at mx.preloaders::Preloader/initialize()[E:\dev\4.y\frameworks\projects\framework\src\mx\preloaders\Preloader.as:261]
at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::initialize()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\SystemManager.as:2097]
at mx.managers::SystemManager/initHandler()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\SystemManager.as:2582]

请问如何为 Flex 项目创建一个完整的 AS 应用程序类?

4

1 回答 1

1

In a Flex Project; you're main application file has to be MXML. Everything else can be ActionScript, though.

于 2013-04-12T15:13:44.343 回答