2013-07-01 30 views
0

我正在將Flex圖表集成到我的Flex 4.6 Web應用程序中,它工作正常,但是當我嘗試在AIR中使用相同的一組代碼時,它會像下面那樣引發運行時錯誤flex中的Fusion圖表集成4.6 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應用程序很好,但不是在空氣中,

<?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> 

如果有人遇到這個問題,請給我一些想法。提前致謝。

回答

0

上面的代碼片斷幾乎沒有問題。首先確保您沒有使用Spark Only Component set。設置MX + Spark Component

我不確定爲什麼上面的代碼片段顯示「s:Application」。如果這是一個AIR應用程序,它應該是「s:WindowedApplication」。

屬性FCDataXML指向一個字符串,該字符串可能是XML文件的名稱。您需要在那裏指定實際的XML。

+0

感謝您的回覆。 – raj

相關問題