0
votes

I am integrating Fusion chart in my Flex 4.6 web application, it is working fine but when i try to use the same set of code in AIR it throws run time error as like below

VerifyError: Error #1014: Class mx.controls::Image could not be found.

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]

Here is my sample code working fine in Web application but not in 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>

If anyone comes across this problem, kindly provide me some idea. Thanks in advance.

1

1 Answers

0
votes

The above code snippets has few problems. First ensure that you are not using Spark Only Component set. Set MX + Spark Component.

I am not sure why the above code snippet is showing "s:Application". If this is an AIR app it should be "s:WindowedApplication".

The attribute FCDataXML is pointing towards a string which is probably the name of the XML file. You need to specify the actual XML there.