问题
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