我在我的 Flex 4.6 Web 应用程序中集成 Fusion 图表,它工作正常,但是当我尝试在 AIR 中使用相同的代码集时,它会引发运行时错误,如下所示
VerifyError:错误 #1014:找不到类 mx.controls::Image。
at FusionChartSample/init()[D:\WorkspaceLocal\TabletSamples\FusionChartAppln\FusionChartSample.mxml:15]
at FusionChartSample/___FusionChartSample_Application1_creationComplete()[D:\WorkspaceLocal\TabletSamples\FusionChartAppln\FusionChartSample.mxml:4]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:13152]
at mx.core::UIComponent/set initialized()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:1818]
at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:842]
at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1180]
这是我在 Web 应用程序中运行良好但在 AIR 中运行良好的示例代码,
<?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" xmlns:components="com.fusioncharts.components.*" xmlns="*" creationComplete="init()" >
<fx:Script>
<![CDATA[
import com.fusioncharts.components.*;
import spark.components.Button;
private var _fusionChart: FusionCharts;
private var sampleXml:XML;
private function init():void {
_fusionChart = new FusionCharts();
_fusionChart.FCChartType = "StackedColumn2D";
_fusionChart.FCDataXML = sampleXml;
_fusionChart.FCFolder = "../fusioncharts/";
_fusionChart.FCRender();
this.addElement(_fusionChart);
}
]]>
</fx:Script>
</s:Application>
如果有人遇到这个问题,请给我一些想法。提前致谢。