我正在尝试在这里找到的hello world示例:http://help.adobe.com/en_US/Flex/4.0/CompilerAPI/flex_4.0_compilerapi.pdf
然而,我一直收到以下错误:
message =“无法解析为组件实现。 路径:/home/xxx/public_html/DSM10.mxml 行:1“
如果我尝试在这里找到的hello world示例,它可以正常工作: http://livedocs.adobe.com/flex/3/compilerAPI_flex3.pdf
我使用apache-tomcat-6.0.35在LAMP堆栈上运行hello world示例。
这是我的代码:
String dirPublicHtml = dirPathApp + "/../../public_html";
String dirOutput = dirPublicHtml + "/outgoing";
File parent = new File(dirPublicHtml).getCanonicalFile();
VirtualLocalFileSystem fs = new VirtualLocalFileSystem();
File dsmFile = new File(parent, "DSM10.mxml");
Flex 4 Compiler API文档中的“Hello World”
VirtualLocalFile lf = fs.create(dsmFile.getCanonicalPath(),
"<?xml version='1.0'?>
<s:Application xmlns:fx='http://ns.adobe.com/mxml/2009'
xmlns:s='library://ns.adobe.com/flex/spark'
xmlns:mx='library://ns.adobe.com/flex/mx'>
<s:Label text='Hello World'/> </s:Application>", parent,
System.currentTimeMillis());
来自Flex 3编译器API的“Hello World”
/*VirtualLocalFile lf = fs.create(dsmFile.getCanonicalPath(),
"<?xml version='1.0'?>
<mx:Application xmlns:mx='http://www.adobe.com/2006/mxml'>
<mx:Label text='Hello World'/></mx:Application>", parent,
System.currentTimeMillis());*/
Application app = new Application(lf);
app.setLogger(logger);
app.setOutput(new File(dirOutput + "/DSM10.swf"));
long result = app.build(true);
lf.close();
if (result <= 0) throw new Exception(logger.getLogMessage());
答案 0 :(得分:1)
因为我在网络服务器上运行“hello world”,我需要上传必要的flex sdk框架和库文件。之前的sdk是3.6。我不得不上传v4.6。在我重新启动apache-tomcat-6.0.35之后,s:应用程序错误消失了,一个新的弹出窗口。所以现在我要修复它,即将as3 / flex代码从sdk 3.6升级到4.6。