Sign in to follow this  

Load FusionChart AS2 Line Graph in Flash CS3 Movie?

Recommended Posts

Is it possible to load a AS2 Fusion Line Graph Line.swf in a Flash CS3 Movie?

I managed to load a AS2 Fushion Line Graph Line.swf in a CS3 Movie but get the data loading data error text.

If this is not possible will the FushionCharts v3 developer licence version allow me to achieve this? 

Share this post

Link to post
Share on other sites

Create a Chart Loading class and named it








import flash.display.*;








// 3rd party API for AVM1-AVM2 communication as our charts are on flas 8 AVM1 version and


// Flash 9 runs on AVM2. AVM stands for Actionscript Virtual Machine.


import flx.external.FlashInterface;




// Main Chartloader class


public class ChartLoader extends Sprite




private var loader:Loader;


private var Xpos:Number,Ypos:Number;


private var Id:String;




// Chartloader constructor


public function ChartLoader(chartURL:String,XMLurl:String,XMLdata:String,chartWidth:Number,chartHeight:Number,xpos:Number,ypos:Number)




// Initialisation of varibles with supplied data.


// chartURL - path of the chart swf


//XMLurl - URL of the supplied data xml file


//XMLdata - Supplied xml data as string


// chartwidth, chartheight - specified width and height of the chart


// xpos, ypos - x and y position of chart on stage.








// Unique ID to separate and identify each chart object.;


// Instantiation of Loader class.


loader = new Loader();


// EventListener to track the completion of chart loading process


loader.contentLoaderInfo.addEventListener(Event.INIT, loaded);


// URLRequest instantiation by passing swf path and params


var urlRequest:URLRequest = new URLRequest(chartURL+"?flashId="+Id+"&defaultdatafile="+XMLurl+"&dataXML="+XMLdata+"&chartwidth="+chartWidth+"&chartheight="+chartHeight+"&mode=flex");


// Loading of chart in loader








// This function will execute after completion of loading of each chart


private function loaded (e:Event):void






// Addition of loader object with dispaly child.




// Positioning of chart






// Dispatching of event to track down the load of charts from outside


dispatchEvent(new Event("chartInitialized"));






// setDataXML function to update the chart.


// Arguments needed as XML string


public function setDataXML(dataxml:String):void






// Call setDataURL function from outside to update chart.


// Argument as a URL string of a specific xml file.


public function setDataURL(dataurl:String):void






// Function to call saveAsImage from outside


public function saveAsImage():void






// Function to call printChart from outside


public function printChart():void
















And from Flash, use it like bellow-




// Import the ChartLoader class


import ChartLoader;




// Demo XML data for setDataXML method.


var xmlData:String="";


var xmlData_2:String="";




// ChartLoader instance creation


var chart1:ChartLoader=new ChartLoader("charts/Line.swf","",xmlData,400,300,0,0);


// Object added to Stage




// ChartLoader instance creation


var chart2:ChartLoader=new ChartLoader("charts/Line.swf","data/chartData.xml","",400,300,410,0);


// Object added to Stage






// Event listener for mouse event






//Button click functions and chart function invocation


function changeData(e:MouseEvent):void








case "buttA1":








case "buttA2":








case "buttB1":








case "buttB2":










trace("No job specified !");











Edited by Guest

Share this post

Link to post
Share on other sites

Hi dbasix

The Graph loads fine initially but when I click the button to update I get an error.

Thanks for the help, just one problem

// Call setDataURL function from outside to update chart.

// Argument as a URL string of a specific xml file.

public function setDataURL(dataurl:String):void


 trace("ID = "+Id);

 trace("FlashInterface = "+FlashInterface);

 trace("Data Url = "+dataurl);".setDataURL",dataurl);


I get this error

ID = instance86

FlashInterface = [class FlashInterface]

Data Url = data/Data.xml

TypeError: Error #1009: Cannot access a property or method of a null object reference.

 at flx.external::FlashInterface$/call()

 at code.maps::ChartLoader/setDataURL()

 at MapService_fla::MainTimeline/changeData()

Share this post

Link to post
Share on other sites
Guest Rajroop

Hello :),




We are really excited to announce the release of FusionCharts for Flex v1.1 featuring the following:




- 12 new chart types: 7 new gauges including Angular gauge, LED gauge and Linear gauge, Spark chart and Bullet graphs have been added.


- All the gauges can fetch data in real-time and come with alert managers and message loggers.


- All the charts and gauges can now be natively exported as images and PDFs.


- The data for all the charts can be exported as CSV.


- Data sets can now have custom text labels instead of numeric values.


- The charts can handle a lot more events to help you manipulate them better.


- Trendlines can also have custom tool-text.


- Custom color palettes can be defined for the data plots.




Learn more about it from and learn what's new in FusionCharts for Flex from




Existing customers can upgrade to the new version from

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this