我创建了一个简单的flex应用程序,其中包含以下代码行
<?xml version="1.0" encoding="utf-8"?>
<s:HGroup xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
</s:HGroup>
当我在flex中运行此应用程序时,我在浏览器上出现以下错误
VerifyError: Error #1014: Class spark.components::HGroup could not be found.
我的Flash制作工具控制台上还有一个警告
`This compilation unit did not have a factoryClass specified in Frame metadata to load the configured runtime shared libraries. To compile without runtime shared libraries either set the -static-link-runtime-shared-libraries option to true or remove the -runtime-shared-libraries option.`
之后我在其他编译器参数中设置了 -static-link-runtime-shared-libraries = true 选项,之后上面的警告变成了后面的错误
`Unable to locate specified base class 'spark.components.HGroup' for component class 'com.region.IRegion'.`
我的flex sdk版本是 flex 4.6.0 在 s:Button 的情况下,我也有同样的问题 你能为这个问题建议一个解决方案吗?
答案 0 :(得分:0)
您的Flex应用程序不能将根作为HGroup。它必须是
适用于flex web应用
<?xml version="1.0" encoding="utf-8"?>
<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" minWidth="955" minHeight="600">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
</s:Application>
对于AIR应用程序:
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
</s:WindowedApplication>