Create actionscript Application file for Flex project

删除回忆录丶 提交于 2019-12-11 19:18:52

问题


I'm trying to create Flex project with an actionscript application file, not a mxml file.

I simply use this code :

package
{   

import spark.components.Application;

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

But I receive this error :

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]

How can I create a full AS application class for Flex project please ?


回答1:


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



来源:https://stackoverflow.com/questions/15972818/create-actionscript-application-file-for-flex-project

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