我创建了一个简单的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的情况下我也有同样的问题:按钮你能为这个问题建议一个解决方案吗?
您的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>